diff --git a/Makefile b/Makefile index 5f2e6cdf..ff47b8c2 100644 --- a/Makefile +++ b/Makefile @@ -21,11 +21,11 @@ clean: rm -rf $(CR_CLIENT) rm -rf $(AWS_INSTANCE_DATA) -test: $(CR_CLIENT) $(AWS_INSTANCE_DATA) +test: $(AWS_INSTANCE_DATA) $(GO) test -v -race -coverprofile=profile.cov $(GOPKGS) $(GO) vet -v $(GOPKGS) -lint: $(CR_CLIENT) $(SOURCES) $(AWS_INSTANCE_DATA) +lint: $(SOURCES) $(AWS_INSTANCE_DATA) $(GO) mod download golangci-lint -v run ./... @@ -36,20 +36,16 @@ $(AWS_DATA_SRC): mkdir -p $(dir $@) curl -L -s --fail https://www.ec2instances.info/instances.json | jq '[.[] | {instance_type, vCPU, memory, storage: (if .storage == null then null else .storage | {devices, size, nvme_ssd} end)}] | sort_by(.instance_type)' > "$@" -$(CR_CLIENT): $(SPEC) - mkdir -p $@ - go run github.com/go-swagger/go-swagger/cmd/swagger generate client --name cluster-registry --principal oauth.User --spec docs/cluster-registry.yaml --target ./$(CR_CLIENT) - build.local: build/$(BINARY) build.linux: build/linux/$(BINARY) build.osx: build/osx/$(BINARY) build.linux.amd64: build/linux/amd64/$(BINARY) build.linux.arm64: build/linux/arm64/$(BINARY) -build/$(BINARY): $(CR_CLIENT) $(SOURCES) $(AWS_INSTANCE_DATA) +build/$(BINARY): $(SOURCES) $(AWS_INSTANCE_DATA) CGO_ENABLED=0 $(GO) build -o build/$(BINARY) $(BUILD_FLAGS) -ldflags "$(LDFLAGS)" ./cmd/$(BINARY) -build/linux/$(BINARY): $(CR_CLIENT) $(SOURCES) $(AWS_INSTANCE_DATA) +build/linux/$(BINARY): $(SOURCES) $(AWS_INSTANCE_DATA) GOOS=linux GOARCH=amd64 CGO_ENABLED=0 $(GO) build $(BUILD_FLAGS) -o build/linux/$(BINARY) -ldflags "$(LDFLAGS)" ./cmd/$(BINARY) build/linux/amd64/%: go.mod $(SOURCES) @@ -58,7 +54,7 @@ build/linux/amd64/%: go.mod $(SOURCES) build/linux/arm64/%: go.mod $(SOURCES) GOOS=linux GOARCH=arm64 CGO_ENABLED=0 $(GO) build $(BUILD_FLAGS) -o build/linux/arm64/$(notdir $@) -ldflags "$(LDFLAGS)" ./cmd/$(notdir $@) -build/osx/$(BINARY): $(CR_CLIENT) $(SOURCES) $(AWS_INSTANCE_DATA) +build/osx/$(BINARY): $(SOURCES) $(AWS_INSTANCE_DATA) GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 $(GO) build $(BUILD_FLAGS) -o build/osx/$(BINARY) -ldflags "$(LDFLAGS)" ./cmd/$(BINARY) build.docker: build.linux diff --git a/api/cluster.go b/api/cluster.go index b864a7fb..8210d4c1 100644 --- a/api/cluster.go +++ b/api/cluster.go @@ -10,8 +10,8 @@ import ( "sort" "strings" + "github.com/zalando-build/cluster-registry/models" "github.com/zalando-incubator/cluster-lifecycle-manager/channel" - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/models" "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/util" ) diff --git a/api/cluster_test.go b/api/cluster_test.go index 288fd286..38df729f 100644 --- a/api/cluster_test.go +++ b/api/cluster_test.go @@ -10,8 +10,8 @@ import ( "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/zalando-build/cluster-registry/models" "github.com/zalando-incubator/cluster-lifecycle-manager/channel" - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/models" ) func fieldNames(value interface{}) ([]string, error) { diff --git a/go.mod b/go.mod index 6c721562..45a75f6f 100644 --- a/go.mod +++ b/go.mod @@ -6,11 +6,11 @@ require ( github.com/cenkalti/backoff v2.2.1+incompatible github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/go-openapi/analysis v0.23.0 // indirect - github.com/go-openapi/errors v0.22.1 + github.com/go-openapi/errors v0.22.1 // indirect github.com/go-openapi/runtime v0.28.0 github.com/go-openapi/strfmt v0.23.0 - github.com/go-openapi/swag v0.23.1 - github.com/go-openapi/validate v0.24.0 + github.com/go-openapi/swag v0.23.1 // indirect + github.com/go-openapi/validate v0.24.0 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-swagger/go-swagger v0.32.3 github.com/golang-jwt/jwt v3.2.2+incompatible @@ -20,11 +20,11 @@ require ( github.com/sirupsen/logrus v1.9.3 github.com/stretchr/testify v1.10.0 github.com/zalando-incubator/kube-ingress-aws-controller v0.17.5 - go.mongodb.org/mongo-driver v1.17.0 // indirect + go.mongodb.org/mongo-driver v1.17.3 // indirect golang.org/x/oauth2 v0.30.0 golang.org/x/sync v0.15.0 - golang.org/x/sys v0.32.0 // indirect - golang.org/x/term v0.31.0 // indirect + golang.org/x/sys v0.33.0 // indirect + golang.org/x/term v0.32.0 // indirect golang.org/x/time v0.11.0 // indirect google.golang.org/protobuf v1.36.6 // indirect gopkg.in/square/go-jose.v2 v2.6.0 @@ -40,14 +40,15 @@ require ( github.com/Masterminds/sprig/v3 v3.3.0 github.com/luci/go-render v0.0.0-20160219211803-9a04cc21af0f github.com/samber/lo v1.51.0 + github.com/zalando-build/cluster-registry v0.14.0 sigs.k8s.io/aws-iam-authenticator v0.7.2 ) require ( dario.cat/mergo v1.0.1 // indirect github.com/Masterminds/goutils v1.1.1 // indirect - github.com/Masterminds/semver/v3 v3.3.0 // indirect - github.com/alecthomas/units v0.0.0-20240626203959-61d1e3462e30 // indirect + github.com/Masterminds/semver/v3 v3.3.1 // indirect + github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect github.com/aws/aws-sdk-go-v2 v1.36.3 // indirect github.com/aws/aws-sdk-go-v2/config v1.29.14 // indirect @@ -77,7 +78,7 @@ require ( github.com/ghodss/yaml v1.0.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-openapi/inflect v0.21.0 // indirect + github.com/go-openapi/inflect v0.21.2 // indirect github.com/go-openapi/jsonpointer v0.21.1 // indirect github.com/go-openapi/jsonreference v0.21.0 // indirect github.com/go-openapi/loads v0.22.0 // indirect @@ -113,7 +114,7 @@ require ( github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.22.0 // indirect github.com/prometheus/client_model v0.6.2 // indirect - github.com/rogpeppe/go-internal v1.13.1 // indirect + github.com/rogpeppe/go-internal v1.14.1 // indirect github.com/sagikazarmark/locafero v0.9.0 // indirect github.com/shopspring/decimal v1.4.0 // indirect github.com/sourcegraph/conc v0.3.0 // indirect @@ -126,15 +127,14 @@ require ( github.com/x448/float16 v0.8.4 // indirect github.com/xhit/go-str2duration/v2 v2.1.0 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect - go.opentelemetry.io/otel v1.35.0 // indirect - go.opentelemetry.io/otel/metric v1.35.0 // indirect - go.opentelemetry.io/otel/sdk v1.28.0 // indirect - go.opentelemetry.io/otel/trace v1.35.0 // indirect + go.opentelemetry.io/otel v1.36.0 // indirect + go.opentelemetry.io/otel/metric v1.36.0 // indirect + go.opentelemetry.io/otel/trace v1.36.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.37.0 // indirect + golang.org/x/crypto v0.38.0 // indirect golang.org/x/mod v0.24.0 // indirect - golang.org/x/net v0.39.0 // indirect - golang.org/x/text v0.24.0 // indirect + golang.org/x/net v0.40.0 // indirect + golang.org/x/text v0.25.0 // indirect golang.org/x/tools v0.32.0 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/go-playground/validator.v9 v9.31.0 // indirect diff --git a/go.sum b/go.sum index 63a9fe33..d86a525d 100644 --- a/go.sum +++ b/go.sum @@ -2,14 +2,14 @@ dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s= dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver/v3 v3.3.0 h1:B8LGeaivUe71a5qox1ICM/JLl0NqZSW5CHyL+hmvYS0= -github.com/Masterminds/semver/v3 v3.3.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= +github.com/Masterminds/semver/v3 v3.3.1 h1:QtNSWtVZ3nBfk8mAOu/B6v7FMJ+NHTIgUPi7rj+4nv4= +github.com/Masterminds/semver/v3 v3.3.1/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= github.com/Masterminds/sprig/v3 v3.3.0 h1:mQh0Yrg1XPo6vjYXgtf5OtijNAKJRNcTdOOGZe3tPhs= github.com/Masterminds/sprig/v3 v3.3.0/go.mod h1:Zy1iXRYNqNLUolqCpL4uhk6SHUMAOSCzdgBfDb35Lz0= github.com/alecthomas/kingpin/v2 v2.4.0 h1:f48lwail6p8zpO1bC4TxtqACaGqHYA22qkHjHpqDjYY= github.com/alecthomas/kingpin/v2 v2.4.0/go.mod h1:0gyi0zQnjuFk8xrkNKamJoyUo382HRL7ATRpFZCw6tE= -github.com/alecthomas/units v0.0.0-20240626203959-61d1e3462e30 h1:t3eaIm0rUkzbrIewtiFmMK5RXHej2XnoXNhxVsAYUfg= -github.com/alecthomas/units v0.0.0-20240626203959-61d1e3462e30/go.mod h1:fvzegU4vN3H1qMT+8wDmzjAcDONcgo2/SZ/TyfdUOFs= +github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b h1:mimo19zliBX/vSQ6PWWSL9lK8qwHozUj03+zLoEB8O0= +github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b/go.mod h1:fvzegU4vN3H1qMT+8wDmzjAcDONcgo2/SZ/TyfdUOFs= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/aws/aws-sdk-go v1.55.7 h1:UJrkFq7es5CShfBwlWAC8DA077vp8PyVbQd3lqLiztE= @@ -84,8 +84,8 @@ github.com/go-openapi/analysis v0.23.0 h1:aGday7OWupfMs+LbmLZG4k0MYXIANxcuBTYUC0 github.com/go-openapi/analysis v0.23.0/go.mod h1:9mz9ZWaSlV8TvjQHLl2mUW2PbZtemkE8yA5v22ohupo= github.com/go-openapi/errors v0.22.1 h1:kslMRRnK7NCb/CvR1q1VWuEQCEIsBGn5GgKD9e+HYhU= github.com/go-openapi/errors v0.22.1/go.mod h1:+n/5UdIqdVnLIJ6Q9Se8HNGUXYaY6CN8ImWzfi/Gzp0= -github.com/go-openapi/inflect v0.21.0 h1:FoBjBTQEcbg2cJUWX6uwL9OyIW8eqc9k4KhN4lfbeYk= -github.com/go-openapi/inflect v0.21.0/go.mod h1:INezMuUu7SJQc2AyR3WO0DqqYUJSj8Kb4hBd7WtjlAw= +github.com/go-openapi/inflect v0.21.2 h1:0gClGlGcxifcJR56zwvhaOulnNgnhc4qTAkob5ObnSM= +github.com/go-openapi/inflect v0.21.2/go.mod h1:INezMuUu7SJQc2AyR3WO0DqqYUJSj8Kb4hBd7WtjlAw= github.com/go-openapi/jsonpointer v0.21.1 h1:whnzv/pNXtK2FbX/W9yJfRmE2gsmkfahjMKB0fZvcic= github.com/go-openapi/jsonpointer v0.21.1/go.mod h1:50I1STOfbY1ycR8jGz8DaMeLCdXiI6aDteEdRNNzpdk= github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= @@ -196,8 +196,8 @@ github.com/prometheus/common v0.63.0/go.mod h1:VVFF/fBIoToEnWRVkYoXEkq3R3paCoxG9 github.com/prometheus/procfs v0.16.1 h1:hZ15bTNuirocR6u0JZ6BAHHmwS1p8B4P6MRqxtzMyRg= github.com/prometheus/procfs v0.16.1/go.mod h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlTmWl8x/U+Is= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= -github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= +github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= +github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= github.com/sagikazarmark/locafero v0.9.0 h1:GbgQGNtTrEmddYDSAH9QLRyfAHY12md+8YFTqyMTC9k= github.com/sagikazarmark/locafero v0.9.0/go.mod h1:UBUyz37V+EdMS3hDF3QWIiVr/2dPrx49OMO0Bn0hJqk= github.com/samber/lo v1.51.0 h1:kysRYLbHy/MB7kQZf5DSN50JHmMsNEdeY24VzJFu7wI= @@ -239,27 +239,29 @@ github.com/xhit/go-str2duration/v2 v2.1.0 h1:lxklc02Drh6ynqX+DdPyp5pCKLUQpRT8bp8 github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/zalando-build/cluster-registry v0.14.0 h1:TPF+wvVmmn4eka/x+t1NKrxdhzZjg7nGpDLh+l0l/3E= +github.com/zalando-build/cluster-registry v0.14.0/go.mod h1:wIB9k6lhJI9gMmcMhzYWWCSpcDfApXzLGBD+2HbcI14= github.com/zalando-incubator/kube-ingress-aws-controller v0.17.5 h1:MLK5sIxzZYqKt3hm9lfGbI2tfKVBb0lEVPpCI1a7UDA= github.com/zalando-incubator/kube-ingress-aws-controller v0.17.5/go.mod h1:YbLpF7n4UECUeEgQIZFj5zNK7W7YBqT8oWEIwUlUbZQ= -go.mongodb.org/mongo-driver v1.17.0 h1:Hp4q2MCjvY19ViwimTs00wHi7G4yzxh4/2+nTx8r40k= -go.mongodb.org/mongo-driver v1.17.0/go.mod h1:wwWm/+BuOddhcq3n68LKRmgk2wXzmF6s0SFOa0GINL4= +go.mongodb.org/mongo-driver v1.17.3 h1:TQyXhnsWfWtgAhMtOgtYHMTkZIfBTpMTsMnd9ZBeHxQ= +go.mongodb.org/mongo-driver v1.17.3/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ= go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= -go.opentelemetry.io/otel v1.35.0 h1:xKWKPxrxB6OtMCbmMY021CqC45J+3Onta9MqjhnusiQ= -go.opentelemetry.io/otel v1.35.0/go.mod h1:UEqy8Zp11hpkUrL73gSlELM0DupHoiq72dR+Zqel/+Y= -go.opentelemetry.io/otel/metric v1.35.0 h1:0znxYu2SNyuMSQT4Y9WDWej0VpcsxkuklLa4/siN90M= -go.opentelemetry.io/otel/metric v1.35.0/go.mod h1:nKVFgxBZ2fReX6IlyW28MgZojkoAkJGaE8CpgeAU3oE= -go.opentelemetry.io/otel/sdk v1.28.0 h1:b9d7hIry8yZsgtbmM0DKyPWMMUMlK9NEKuIG4aBqWyE= -go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8zjcZEfu7Pg= -go.opentelemetry.io/otel/trace v1.35.0 h1:dPpEfJu1sDIqruz7BHFG3c7528f6ddfSWfFDVt/xgMs= -go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc= +go.opentelemetry.io/otel v1.36.0 h1:UumtzIklRBY6cI/lllNZlALOF5nNIzJVb16APdvgTXg= +go.opentelemetry.io/otel v1.36.0/go.mod h1:/TcFMXYjyRNh8khOAO9ybYkqaDBb/70aVwkNML4pP8E= +go.opentelemetry.io/otel/metric v1.36.0 h1:MoWPKVhQvJ+eeXWHFBOPoBOi20jh6Iq2CcCREuTYufE= +go.opentelemetry.io/otel/metric v1.36.0/go.mod h1:zC7Ks+yeyJt4xig9DEw9kuUFe5C3zLbVjV2PzT6qzbs= +go.opentelemetry.io/otel/sdk v1.35.0 h1:iPctf8iprVySXSKJffSS79eOjl9pvxV9ZqOWT0QejKY= +go.opentelemetry.io/otel/sdk v1.35.0/go.mod h1:+ga1bZliga3DxJ3CQGg3updiaAJoNECOgJREo9KHGQg= +go.opentelemetry.io/otel/trace v1.36.0 h1:ahxWNuqZjpdiFAyrIoQ4GIiAIhxAunQR6MUoKrsNd4w= +go.opentelemetry.io/otel/trace v1.36.0/go.mod h1:gQ+OnDZzrybY4k4seLzPAWNwVBBVlF2szhehOBB/tGA= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 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.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE= -golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc= +golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8= +golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw= 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.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= @@ -268,8 +270,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/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-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY= -golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E= +golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY= +golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds= golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI= golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -282,14 +284,14 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20= -golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/term v0.31.0 h1:erwDkOK1Msy6offm1mOgvspSkslFnIGsFnxOKoufg3o= -golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw= +golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= +golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg= +golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= -golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= +golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4= +golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA= golang.org/x/time v0.11.0 h1:/bpjEDfN9tkoN/ryeYHnv5hcMlc8ncjMcM4XBk5NWV0= golang.org/x/time v0.11.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/pkg/cluster-registry/client/cluster_registry_client.go b/pkg/cluster-registry/client/cluster_registry_client.go deleted file mode 100644 index 908f589b..00000000 --- a/pkg/cluster-registry/client/cluster_registry_client.go +++ /dev/null @@ -1,132 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/client/clusters" - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/client/config_items" - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/client/infrastructure_accounts" - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/client/node_pool_config_items" - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/client/node_pools" -) - -// Default cluster registry HTTP client. -var Default = NewHTTPClient(nil) - -const ( - // DefaultHost is the default Host - // found in Meta (info) section of spec file - DefaultHost string = "localhost" - // DefaultBasePath is the default BasePath - // found in Meta (info) section of spec file - DefaultBasePath string = "/" -) - -// DefaultSchemes are the default schemes found in Meta (info) section of spec file -var DefaultSchemes = []string{"https"} - -// NewHTTPClient creates a new cluster registry HTTP client. -func NewHTTPClient(formats strfmt.Registry) *ClusterRegistry { - return NewHTTPClientWithConfig(formats, nil) -} - -// NewHTTPClientWithConfig creates a new cluster registry HTTP client, -// using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *ClusterRegistry { - // ensure nullable parameters have default - if cfg == nil { - cfg = DefaultTransportConfig() - } - - // create transport and client - transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) - return New(transport, formats) -} - -// New creates a new cluster registry client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *ClusterRegistry { - // ensure nullable parameters have default - if formats == nil { - formats = strfmt.Default - } - - cli := new(ClusterRegistry) - cli.Transport = transport - cli.Clusters = clusters.New(transport, formats) - cli.ConfigItems = config_items.New(transport, formats) - cli.InfrastructureAccounts = infrastructure_accounts.New(transport, formats) - cli.NodePoolConfigItems = node_pool_config_items.New(transport, formats) - cli.NodePools = node_pools.New(transport, formats) - return cli -} - -// DefaultTransportConfig creates a TransportConfig with the -// default settings taken from the meta section of the spec file. -func DefaultTransportConfig() *TransportConfig { - return &TransportConfig{ - Host: DefaultHost, - BasePath: DefaultBasePath, - Schemes: DefaultSchemes, - } -} - -// TransportConfig contains the transport related info, -// found in the meta section of the spec file. -type TransportConfig struct { - Host string - BasePath string - Schemes []string -} - -// WithHost overrides the default host, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithHost(host string) *TransportConfig { - cfg.Host = host - return cfg -} - -// WithBasePath overrides the default basePath, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { - cfg.BasePath = basePath - return cfg -} - -// WithSchemes overrides the default schemes, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { - cfg.Schemes = schemes - return cfg -} - -// ClusterRegistry is a client for cluster registry -type ClusterRegistry struct { - Clusters clusters.ClientService - - ConfigItems config_items.ClientService - - InfrastructureAccounts infrastructure_accounts.ClientService - - NodePoolConfigItems node_pool_config_items.ClientService - - NodePools node_pools.ClientService - - Transport runtime.ClientTransport -} - -// SetTransport changes the transport on the client and all its subresources -func (c *ClusterRegistry) SetTransport(transport runtime.ClientTransport) { - c.Transport = transport - c.Clusters.SetTransport(transport) - c.ConfigItems.SetTransport(transport) - c.InfrastructureAccounts.SetTransport(transport) - c.NodePoolConfigItems.SetTransport(transport) - c.NodePools.SetTransport(transport) -} diff --git a/pkg/cluster-registry/client/clusters/clusters_client.go b/pkg/cluster-registry/client/clusters/clusters_client.go deleted file mode 100644 index 9b7565dc..00000000 --- a/pkg/cluster-registry/client/clusters/clusters_client.go +++ /dev/null @@ -1,280 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package clusters - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new clusters API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new clusters API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new clusters API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for clusters API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreateCluster(params *CreateClusterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateClusterCreated, error) - - DeleteCluster(params *DeleteClusterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteClusterNoContent, error) - - GetCluster(params *GetClusterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetClusterOK, error) - - ListClusters(params *ListClustersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListClustersOK, error) - - UpdateCluster(params *UpdateClusterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateClusterOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -CreateCluster creates cluster - -Create a cluster. -*/ -func (a *Client) CreateCluster(params *CreateClusterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateClusterCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateClusterParams() - } - op := &runtime.ClientOperation{ - ID: "createCluster", - Method: "POST", - PathPattern: "/kubernetes-clusters", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &CreateClusterReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateClusterCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createCluster: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -DeleteCluster deletes cluster - -Cluster identified by the ID. -*/ -func (a *Client) DeleteCluster(params *DeleteClusterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteClusterNoContent, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteClusterParams() - } - op := &runtime.ClientOperation{ - ID: "deleteCluster", - Method: "DELETE", - PathPattern: "/kubernetes-clusters/{cluster_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DeleteClusterReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteClusterNoContent) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteCluster: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -GetCluster gets single cluster - -Read the details of the cluster. -*/ -func (a *Client) GetCluster(params *GetClusterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetClusterOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetClusterParams() - } - op := &runtime.ClientOperation{ - ID: "getCluster", - Method: "GET", - PathPattern: "/kubernetes-clusters/{cluster_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &GetClusterReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetClusterOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getCluster: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -ListClusters lists all kubernetes clusters - -Returns the list of all Kubernetes clusters. -*/ -func (a *Client) ListClusters(params *ListClustersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListClustersOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListClustersParams() - } - op := &runtime.ClientOperation{ - ID: "listClusters", - Method: "GET", - PathPattern: "/kubernetes-clusters", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListClustersReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListClustersOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listClusters: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -UpdateCluster updates cluster - -update a cluster. -*/ -func (a *Client) UpdateCluster(params *UpdateClusterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateClusterOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateClusterParams() - } - op := &runtime.ClientOperation{ - ID: "updateCluster", - Method: "PATCH", - PathPattern: "/kubernetes-clusters/{cluster_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &UpdateClusterReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateClusterOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateCluster: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/pkg/cluster-registry/client/clusters/create_cluster_parameters.go b/pkg/cluster-registry/client/clusters/create_cluster_parameters.go deleted file mode 100644 index d0c15b48..00000000 --- a/pkg/cluster-registry/client/clusters/create_cluster_parameters.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package clusters - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/models" -) - -// NewCreateClusterParams creates a new CreateClusterParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateClusterParams() *CreateClusterParams { - return &CreateClusterParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateClusterParamsWithTimeout creates a new CreateClusterParams object -// with the ability to set a timeout on a request. -func NewCreateClusterParamsWithTimeout(timeout time.Duration) *CreateClusterParams { - return &CreateClusterParams{ - timeout: timeout, - } -} - -// NewCreateClusterParamsWithContext creates a new CreateClusterParams object -// with the ability to set a context for a request. -func NewCreateClusterParamsWithContext(ctx context.Context) *CreateClusterParams { - return &CreateClusterParams{ - Context: ctx, - } -} - -// NewCreateClusterParamsWithHTTPClient creates a new CreateClusterParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateClusterParamsWithHTTPClient(client *http.Client) *CreateClusterParams { - return &CreateClusterParams{ - HTTPClient: client, - } -} - -/* -CreateClusterParams contains all the parameters to send to the API endpoint - - for the create cluster operation. - - Typically these are written to a http.Request. -*/ -type CreateClusterParams struct { - - /* Cluster. - - Cluster that will be created. - */ - Cluster *models.Cluster - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create cluster params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateClusterParams) WithDefaults() *CreateClusterParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create cluster params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateClusterParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create cluster params -func (o *CreateClusterParams) WithTimeout(timeout time.Duration) *CreateClusterParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create cluster params -func (o *CreateClusterParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create cluster params -func (o *CreateClusterParams) WithContext(ctx context.Context) *CreateClusterParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create cluster params -func (o *CreateClusterParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create cluster params -func (o *CreateClusterParams) WithHTTPClient(client *http.Client) *CreateClusterParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create cluster params -func (o *CreateClusterParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCluster adds the cluster to the create cluster params -func (o *CreateClusterParams) WithCluster(cluster *models.Cluster) *CreateClusterParams { - o.SetCluster(cluster) - return o -} - -// SetCluster adds the cluster to the create cluster params -func (o *CreateClusterParams) SetCluster(cluster *models.Cluster) { - o.Cluster = cluster -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateClusterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Cluster != nil { - if err := r.SetBodyParam(o.Cluster); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/cluster-registry/client/clusters/create_cluster_responses.go b/pkg/cluster-registry/client/clusters/create_cluster_responses.go deleted file mode 100644 index 85bfc591..00000000 --- a/pkg/cluster-registry/client/clusters/create_cluster_responses.go +++ /dev/null @@ -1,444 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package clusters - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/models" -) - -// CreateClusterReader is a Reader for the CreateCluster structure. -type CreateClusterReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateClusterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreateClusterCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateClusterBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreateClusterUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewCreateClusterForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewCreateClusterConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewCreateClusterInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /kubernetes-clusters] createCluster", response, response.Code()) - } -} - -// NewCreateClusterCreated creates a CreateClusterCreated with default headers values -func NewCreateClusterCreated() *CreateClusterCreated { - return &CreateClusterCreated{} -} - -/* -CreateClusterCreated describes a response with status code 201, with default header values. - -The cluster creation request is accepted -*/ -type CreateClusterCreated struct { - Payload *models.Cluster -} - -// IsSuccess returns true when this create cluster created response has a 2xx status code -func (o *CreateClusterCreated) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this create cluster created response has a 3xx status code -func (o *CreateClusterCreated) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create cluster created response has a 4xx status code -func (o *CreateClusterCreated) IsClientError() bool { - return false -} - -// IsServerError returns true when this create cluster created response has a 5xx status code -func (o *CreateClusterCreated) IsServerError() bool { - return false -} - -// IsCode returns true when this create cluster created response a status code equal to that given -func (o *CreateClusterCreated) IsCode(code int) bool { - return code == 201 -} - -// Code gets the status code for the create cluster created response -func (o *CreateClusterCreated) Code() int { - return 201 -} - -func (o *CreateClusterCreated) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /kubernetes-clusters][%d] createClusterCreated %s", 201, payload) -} - -func (o *CreateClusterCreated) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /kubernetes-clusters][%d] createClusterCreated %s", 201, payload) -} - -func (o *CreateClusterCreated) GetPayload() *models.Cluster { - return o.Payload -} - -func (o *CreateClusterCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Cluster) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateClusterBadRequest creates a CreateClusterBadRequest with default headers values -func NewCreateClusterBadRequest() *CreateClusterBadRequest { - return &CreateClusterBadRequest{} -} - -/* -CreateClusterBadRequest describes a response with status code 400, with default header values. - -Invalid request -*/ -type CreateClusterBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this create cluster bad request response has a 2xx status code -func (o *CreateClusterBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create cluster bad request response has a 3xx status code -func (o *CreateClusterBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create cluster bad request response has a 4xx status code -func (o *CreateClusterBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this create cluster bad request response has a 5xx status code -func (o *CreateClusterBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this create cluster bad request response a status code equal to that given -func (o *CreateClusterBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the create cluster bad request response -func (o *CreateClusterBadRequest) Code() int { - return 400 -} - -func (o *CreateClusterBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /kubernetes-clusters][%d] createClusterBadRequest %s", 400, payload) -} - -func (o *CreateClusterBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /kubernetes-clusters][%d] createClusterBadRequest %s", 400, payload) -} - -func (o *CreateClusterBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateClusterBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateClusterUnauthorized creates a CreateClusterUnauthorized with default headers values -func NewCreateClusterUnauthorized() *CreateClusterUnauthorized { - return &CreateClusterUnauthorized{} -} - -/* -CreateClusterUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type CreateClusterUnauthorized struct { -} - -// IsSuccess returns true when this create cluster unauthorized response has a 2xx status code -func (o *CreateClusterUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create cluster unauthorized response has a 3xx status code -func (o *CreateClusterUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create cluster unauthorized response has a 4xx status code -func (o *CreateClusterUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this create cluster unauthorized response has a 5xx status code -func (o *CreateClusterUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this create cluster unauthorized response a status code equal to that given -func (o *CreateClusterUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the create cluster unauthorized response -func (o *CreateClusterUnauthorized) Code() int { - return 401 -} - -func (o *CreateClusterUnauthorized) Error() string { - return fmt.Sprintf("[POST /kubernetes-clusters][%d] createClusterUnauthorized", 401) -} - -func (o *CreateClusterUnauthorized) String() string { - return fmt.Sprintf("[POST /kubernetes-clusters][%d] createClusterUnauthorized", 401) -} - -func (o *CreateClusterUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewCreateClusterForbidden creates a CreateClusterForbidden with default headers values -func NewCreateClusterForbidden() *CreateClusterForbidden { - return &CreateClusterForbidden{} -} - -/* -CreateClusterForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type CreateClusterForbidden struct { -} - -// IsSuccess returns true when this create cluster forbidden response has a 2xx status code -func (o *CreateClusterForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create cluster forbidden response has a 3xx status code -func (o *CreateClusterForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create cluster forbidden response has a 4xx status code -func (o *CreateClusterForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this create cluster forbidden response has a 5xx status code -func (o *CreateClusterForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this create cluster forbidden response a status code equal to that given -func (o *CreateClusterForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the create cluster forbidden response -func (o *CreateClusterForbidden) Code() int { - return 403 -} - -func (o *CreateClusterForbidden) Error() string { - return fmt.Sprintf("[POST /kubernetes-clusters][%d] createClusterForbidden", 403) -} - -func (o *CreateClusterForbidden) String() string { - return fmt.Sprintf("[POST /kubernetes-clusters][%d] createClusterForbidden", 403) -} - -func (o *CreateClusterForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewCreateClusterConflict creates a CreateClusterConflict with default headers values -func NewCreateClusterConflict() *CreateClusterConflict { - return &CreateClusterConflict{} -} - -/* -CreateClusterConflict describes a response with status code 409, with default header values. - -Conflict, already existing -*/ -type CreateClusterConflict struct { -} - -// IsSuccess returns true when this create cluster conflict response has a 2xx status code -func (o *CreateClusterConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create cluster conflict response has a 3xx status code -func (o *CreateClusterConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create cluster conflict response has a 4xx status code -func (o *CreateClusterConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this create cluster conflict response has a 5xx status code -func (o *CreateClusterConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this create cluster conflict response a status code equal to that given -func (o *CreateClusterConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the create cluster conflict response -func (o *CreateClusterConflict) Code() int { - return 409 -} - -func (o *CreateClusterConflict) Error() string { - return fmt.Sprintf("[POST /kubernetes-clusters][%d] createClusterConflict", 409) -} - -func (o *CreateClusterConflict) String() string { - return fmt.Sprintf("[POST /kubernetes-clusters][%d] createClusterConflict", 409) -} - -func (o *CreateClusterConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewCreateClusterInternalServerError creates a CreateClusterInternalServerError with default headers values -func NewCreateClusterInternalServerError() *CreateClusterInternalServerError { - return &CreateClusterInternalServerError{} -} - -/* -CreateClusterInternalServerError describes a response with status code 500, with default header values. - -Unexpected error -*/ -type CreateClusterInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this create cluster internal server error response has a 2xx status code -func (o *CreateClusterInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create cluster internal server error response has a 3xx status code -func (o *CreateClusterInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create cluster internal server error response has a 4xx status code -func (o *CreateClusterInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this create cluster internal server error response has a 5xx status code -func (o *CreateClusterInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this create cluster internal server error response a status code equal to that given -func (o *CreateClusterInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the create cluster internal server error response -func (o *CreateClusterInternalServerError) Code() int { - return 500 -} - -func (o *CreateClusterInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /kubernetes-clusters][%d] createClusterInternalServerError %s", 500, payload) -} - -func (o *CreateClusterInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /kubernetes-clusters][%d] createClusterInternalServerError %s", 500, payload) -} - -func (o *CreateClusterInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateClusterInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/cluster-registry/client/clusters/delete_cluster_parameters.go b/pkg/cluster-registry/client/clusters/delete_cluster_parameters.go deleted file mode 100644 index 380fe7be..00000000 --- a/pkg/cluster-registry/client/clusters/delete_cluster_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package clusters - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteClusterParams creates a new DeleteClusterParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteClusterParams() *DeleteClusterParams { - return &DeleteClusterParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteClusterParamsWithTimeout creates a new DeleteClusterParams object -// with the ability to set a timeout on a request. -func NewDeleteClusterParamsWithTimeout(timeout time.Duration) *DeleteClusterParams { - return &DeleteClusterParams{ - timeout: timeout, - } -} - -// NewDeleteClusterParamsWithContext creates a new DeleteClusterParams object -// with the ability to set a context for a request. -func NewDeleteClusterParamsWithContext(ctx context.Context) *DeleteClusterParams { - return &DeleteClusterParams{ - Context: ctx, - } -} - -// NewDeleteClusterParamsWithHTTPClient creates a new DeleteClusterParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteClusterParamsWithHTTPClient(client *http.Client) *DeleteClusterParams { - return &DeleteClusterParams{ - HTTPClient: client, - } -} - -/* -DeleteClusterParams contains all the parameters to send to the API endpoint - - for the delete cluster operation. - - Typically these are written to a http.Request. -*/ -type DeleteClusterParams struct { - - /* ClusterID. - - ID of the cluster. - */ - ClusterID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete cluster params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteClusterParams) WithDefaults() *DeleteClusterParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete cluster params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteClusterParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete cluster params -func (o *DeleteClusterParams) WithTimeout(timeout time.Duration) *DeleteClusterParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete cluster params -func (o *DeleteClusterParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete cluster params -func (o *DeleteClusterParams) WithContext(ctx context.Context) *DeleteClusterParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete cluster params -func (o *DeleteClusterParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete cluster params -func (o *DeleteClusterParams) WithHTTPClient(client *http.Client) *DeleteClusterParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete cluster params -func (o *DeleteClusterParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithClusterID adds the clusterID to the delete cluster params -func (o *DeleteClusterParams) WithClusterID(clusterID string) *DeleteClusterParams { - o.SetClusterID(clusterID) - return o -} - -// SetClusterID adds the clusterId to the delete cluster params -func (o *DeleteClusterParams) SetClusterID(clusterID string) { - o.ClusterID = clusterID -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteClusterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cluster_id - if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/cluster-registry/client/clusters/delete_cluster_responses.go b/pkg/cluster-registry/client/clusters/delete_cluster_responses.go deleted file mode 100644 index 4469b55c..00000000 --- a/pkg/cluster-registry/client/clusters/delete_cluster_responses.go +++ /dev/null @@ -1,444 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package clusters - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/models" -) - -// DeleteClusterReader is a Reader for the DeleteCluster structure. -type DeleteClusterReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteClusterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 204: - result := NewDeleteClusterNoContent() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewDeleteClusterBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewDeleteClusterUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewDeleteClusterForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDeleteClusterNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewDeleteClusterInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /kubernetes-clusters/{cluster_id}] deleteCluster", response, response.Code()) - } -} - -// NewDeleteClusterNoContent creates a DeleteClusterNoContent with default headers values -func NewDeleteClusterNoContent() *DeleteClusterNoContent { - return &DeleteClusterNoContent{} -} - -/* -DeleteClusterNoContent describes a response with status code 204, with default header values. - -Cluster deleted -*/ -type DeleteClusterNoContent struct { -} - -// IsSuccess returns true when this delete cluster no content response has a 2xx status code -func (o *DeleteClusterNoContent) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this delete cluster no content response has a 3xx status code -func (o *DeleteClusterNoContent) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete cluster no content response has a 4xx status code -func (o *DeleteClusterNoContent) IsClientError() bool { - return false -} - -// IsServerError returns true when this delete cluster no content response has a 5xx status code -func (o *DeleteClusterNoContent) IsServerError() bool { - return false -} - -// IsCode returns true when this delete cluster no content response a status code equal to that given -func (o *DeleteClusterNoContent) IsCode(code int) bool { - return code == 204 -} - -// Code gets the status code for the delete cluster no content response -func (o *DeleteClusterNoContent) Code() int { - return 204 -} - -func (o *DeleteClusterNoContent) Error() string { - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}][%d] deleteClusterNoContent", 204) -} - -func (o *DeleteClusterNoContent) String() string { - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}][%d] deleteClusterNoContent", 204) -} - -func (o *DeleteClusterNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewDeleteClusterBadRequest creates a DeleteClusterBadRequest with default headers values -func NewDeleteClusterBadRequest() *DeleteClusterBadRequest { - return &DeleteClusterBadRequest{} -} - -/* -DeleteClusterBadRequest describes a response with status code 400, with default header values. - -Invalid request -*/ -type DeleteClusterBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this delete cluster bad request response has a 2xx status code -func (o *DeleteClusterBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this delete cluster bad request response has a 3xx status code -func (o *DeleteClusterBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete cluster bad request response has a 4xx status code -func (o *DeleteClusterBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this delete cluster bad request response has a 5xx status code -func (o *DeleteClusterBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this delete cluster bad request response a status code equal to that given -func (o *DeleteClusterBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the delete cluster bad request response -func (o *DeleteClusterBadRequest) Code() int { - return 400 -} - -func (o *DeleteClusterBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}][%d] deleteClusterBadRequest %s", 400, payload) -} - -func (o *DeleteClusterBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}][%d] deleteClusterBadRequest %s", 400, payload) -} - -func (o *DeleteClusterBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *DeleteClusterBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteClusterUnauthorized creates a DeleteClusterUnauthorized with default headers values -func NewDeleteClusterUnauthorized() *DeleteClusterUnauthorized { - return &DeleteClusterUnauthorized{} -} - -/* -DeleteClusterUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type DeleteClusterUnauthorized struct { -} - -// IsSuccess returns true when this delete cluster unauthorized response has a 2xx status code -func (o *DeleteClusterUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this delete cluster unauthorized response has a 3xx status code -func (o *DeleteClusterUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete cluster unauthorized response has a 4xx status code -func (o *DeleteClusterUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this delete cluster unauthorized response has a 5xx status code -func (o *DeleteClusterUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this delete cluster unauthorized response a status code equal to that given -func (o *DeleteClusterUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the delete cluster unauthorized response -func (o *DeleteClusterUnauthorized) Code() int { - return 401 -} - -func (o *DeleteClusterUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}][%d] deleteClusterUnauthorized", 401) -} - -func (o *DeleteClusterUnauthorized) String() string { - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}][%d] deleteClusterUnauthorized", 401) -} - -func (o *DeleteClusterUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewDeleteClusterForbidden creates a DeleteClusterForbidden with default headers values -func NewDeleteClusterForbidden() *DeleteClusterForbidden { - return &DeleteClusterForbidden{} -} - -/* -DeleteClusterForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type DeleteClusterForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this delete cluster forbidden response has a 2xx status code -func (o *DeleteClusterForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this delete cluster forbidden response has a 3xx status code -func (o *DeleteClusterForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete cluster forbidden response has a 4xx status code -func (o *DeleteClusterForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this delete cluster forbidden response has a 5xx status code -func (o *DeleteClusterForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this delete cluster forbidden response a status code equal to that given -func (o *DeleteClusterForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the delete cluster forbidden response -func (o *DeleteClusterForbidden) Code() int { - return 403 -} - -func (o *DeleteClusterForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}][%d] deleteClusterForbidden %s", 403, payload) -} - -func (o *DeleteClusterForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}][%d] deleteClusterForbidden %s", 403, payload) -} - -func (o *DeleteClusterForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *DeleteClusterForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteClusterNotFound creates a DeleteClusterNotFound with default headers values -func NewDeleteClusterNotFound() *DeleteClusterNotFound { - return &DeleteClusterNotFound{} -} - -/* -DeleteClusterNotFound describes a response with status code 404, with default header values. - -Cluster not found -*/ -type DeleteClusterNotFound struct { -} - -// IsSuccess returns true when this delete cluster not found response has a 2xx status code -func (o *DeleteClusterNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this delete cluster not found response has a 3xx status code -func (o *DeleteClusterNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete cluster not found response has a 4xx status code -func (o *DeleteClusterNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this delete cluster not found response has a 5xx status code -func (o *DeleteClusterNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this delete cluster not found response a status code equal to that given -func (o *DeleteClusterNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the delete cluster not found response -func (o *DeleteClusterNotFound) Code() int { - return 404 -} - -func (o *DeleteClusterNotFound) Error() string { - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}][%d] deleteClusterNotFound", 404) -} - -func (o *DeleteClusterNotFound) String() string { - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}][%d] deleteClusterNotFound", 404) -} - -func (o *DeleteClusterNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewDeleteClusterInternalServerError creates a DeleteClusterInternalServerError with default headers values -func NewDeleteClusterInternalServerError() *DeleteClusterInternalServerError { - return &DeleteClusterInternalServerError{} -} - -/* -DeleteClusterInternalServerError describes a response with status code 500, with default header values. - -Unexpected error -*/ -type DeleteClusterInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this delete cluster internal server error response has a 2xx status code -func (o *DeleteClusterInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this delete cluster internal server error response has a 3xx status code -func (o *DeleteClusterInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete cluster internal server error response has a 4xx status code -func (o *DeleteClusterInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this delete cluster internal server error response has a 5xx status code -func (o *DeleteClusterInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this delete cluster internal server error response a status code equal to that given -func (o *DeleteClusterInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the delete cluster internal server error response -func (o *DeleteClusterInternalServerError) Code() int { - return 500 -} - -func (o *DeleteClusterInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}][%d] deleteClusterInternalServerError %s", 500, payload) -} - -func (o *DeleteClusterInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}][%d] deleteClusterInternalServerError %s", 500, payload) -} - -func (o *DeleteClusterInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *DeleteClusterInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/cluster-registry/client/clusters/get_cluster_parameters.go b/pkg/cluster-registry/client/clusters/get_cluster_parameters.go deleted file mode 100644 index b6150cb8..00000000 --- a/pkg/cluster-registry/client/clusters/get_cluster_parameters.go +++ /dev/null @@ -1,199 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package clusters - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewGetClusterParams creates a new GetClusterParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetClusterParams() *GetClusterParams { - return &GetClusterParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetClusterParamsWithTimeout creates a new GetClusterParams object -// with the ability to set a timeout on a request. -func NewGetClusterParamsWithTimeout(timeout time.Duration) *GetClusterParams { - return &GetClusterParams{ - timeout: timeout, - } -} - -// NewGetClusterParamsWithContext creates a new GetClusterParams object -// with the ability to set a context for a request. -func NewGetClusterParamsWithContext(ctx context.Context) *GetClusterParams { - return &GetClusterParams{ - Context: ctx, - } -} - -// NewGetClusterParamsWithHTTPClient creates a new GetClusterParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetClusterParamsWithHTTPClient(client *http.Client) *GetClusterParams { - return &GetClusterParams{ - HTTPClient: client, - } -} - -/* -GetClusterParams contains all the parameters to send to the API endpoint - - for the get cluster operation. - - Typically these are written to a http.Request. -*/ -type GetClusterParams struct { - - /* ClusterID. - - ID of the cluster. - */ - ClusterID string - - /* Verbose. - - Include technical data (config items, node pools) in the response, true by default - - Default: true - */ - Verbose *bool - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get cluster params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetClusterParams) WithDefaults() *GetClusterParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get cluster params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetClusterParams) SetDefaults() { - var ( - verboseDefault = bool(true) - ) - - val := GetClusterParams{ - Verbose: &verboseDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the get cluster params -func (o *GetClusterParams) WithTimeout(timeout time.Duration) *GetClusterParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get cluster params -func (o *GetClusterParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get cluster params -func (o *GetClusterParams) WithContext(ctx context.Context) *GetClusterParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get cluster params -func (o *GetClusterParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get cluster params -func (o *GetClusterParams) WithHTTPClient(client *http.Client) *GetClusterParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get cluster params -func (o *GetClusterParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithClusterID adds the clusterID to the get cluster params -func (o *GetClusterParams) WithClusterID(clusterID string) *GetClusterParams { - o.SetClusterID(clusterID) - return o -} - -// SetClusterID adds the clusterId to the get cluster params -func (o *GetClusterParams) SetClusterID(clusterID string) { - o.ClusterID = clusterID -} - -// WithVerbose adds the verbose to the get cluster params -func (o *GetClusterParams) WithVerbose(verbose *bool) *GetClusterParams { - o.SetVerbose(verbose) - return o -} - -// SetVerbose adds the verbose to the get cluster params -func (o *GetClusterParams) SetVerbose(verbose *bool) { - o.Verbose = verbose -} - -// WriteToRequest writes these params to a swagger request -func (o *GetClusterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cluster_id - if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { - return err - } - - if o.Verbose != nil { - - // query param verbose - var qrVerbose bool - - if o.Verbose != nil { - qrVerbose = *o.Verbose - } - qVerbose := swag.FormatBool(qrVerbose) - if qVerbose != "" { - - if err := r.SetQueryParam("verbose", qVerbose); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/cluster-registry/client/clusters/get_cluster_responses.go b/pkg/cluster-registry/client/clusters/get_cluster_responses.go deleted file mode 100644 index fa56f46b..00000000 --- a/pkg/cluster-registry/client/clusters/get_cluster_responses.go +++ /dev/null @@ -1,368 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package clusters - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/models" -) - -// GetClusterReader is a Reader for the GetCluster structure. -type GetClusterReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetClusterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetClusterOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetClusterUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetClusterForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewGetClusterNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetClusterInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /kubernetes-clusters/{cluster_id}] getCluster", response, response.Code()) - } -} - -// NewGetClusterOK creates a GetClusterOK with default headers values -func NewGetClusterOK() *GetClusterOK { - return &GetClusterOK{} -} - -/* -GetClusterOK describes a response with status code 200, with default header values. - -Cluster information. -*/ -type GetClusterOK struct { - Payload *models.Cluster -} - -// IsSuccess returns true when this get cluster o k response has a 2xx status code -func (o *GetClusterOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this get cluster o k response has a 3xx status code -func (o *GetClusterOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get cluster o k response has a 4xx status code -func (o *GetClusterOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this get cluster o k response has a 5xx status code -func (o *GetClusterOK) IsServerError() bool { - return false -} - -// IsCode returns true when this get cluster o k response a status code equal to that given -func (o *GetClusterOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the get cluster o k response -func (o *GetClusterOK) Code() int { - return 200 -} - -func (o *GetClusterOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /kubernetes-clusters/{cluster_id}][%d] getClusterOK %s", 200, payload) -} - -func (o *GetClusterOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /kubernetes-clusters/{cluster_id}][%d] getClusterOK %s", 200, payload) -} - -func (o *GetClusterOK) GetPayload() *models.Cluster { - return o.Payload -} - -func (o *GetClusterOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Cluster) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetClusterUnauthorized creates a GetClusterUnauthorized with default headers values -func NewGetClusterUnauthorized() *GetClusterUnauthorized { - return &GetClusterUnauthorized{} -} - -/* -GetClusterUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type GetClusterUnauthorized struct { -} - -// IsSuccess returns true when this get cluster unauthorized response has a 2xx status code -func (o *GetClusterUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this get cluster unauthorized response has a 3xx status code -func (o *GetClusterUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get cluster unauthorized response has a 4xx status code -func (o *GetClusterUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this get cluster unauthorized response has a 5xx status code -func (o *GetClusterUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this get cluster unauthorized response a status code equal to that given -func (o *GetClusterUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the get cluster unauthorized response -func (o *GetClusterUnauthorized) Code() int { - return 401 -} - -func (o *GetClusterUnauthorized) Error() string { - return fmt.Sprintf("[GET /kubernetes-clusters/{cluster_id}][%d] getClusterUnauthorized", 401) -} - -func (o *GetClusterUnauthorized) String() string { - return fmt.Sprintf("[GET /kubernetes-clusters/{cluster_id}][%d] getClusterUnauthorized", 401) -} - -func (o *GetClusterUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewGetClusterForbidden creates a GetClusterForbidden with default headers values -func NewGetClusterForbidden() *GetClusterForbidden { - return &GetClusterForbidden{} -} - -/* -GetClusterForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type GetClusterForbidden struct { -} - -// IsSuccess returns true when this get cluster forbidden response has a 2xx status code -func (o *GetClusterForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this get cluster forbidden response has a 3xx status code -func (o *GetClusterForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get cluster forbidden response has a 4xx status code -func (o *GetClusterForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this get cluster forbidden response has a 5xx status code -func (o *GetClusterForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this get cluster forbidden response a status code equal to that given -func (o *GetClusterForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the get cluster forbidden response -func (o *GetClusterForbidden) Code() int { - return 403 -} - -func (o *GetClusterForbidden) Error() string { - return fmt.Sprintf("[GET /kubernetes-clusters/{cluster_id}][%d] getClusterForbidden", 403) -} - -func (o *GetClusterForbidden) String() string { - return fmt.Sprintf("[GET /kubernetes-clusters/{cluster_id}][%d] getClusterForbidden", 403) -} - -func (o *GetClusterForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewGetClusterNotFound creates a GetClusterNotFound with default headers values -func NewGetClusterNotFound() *GetClusterNotFound { - return &GetClusterNotFound{} -} - -/* -GetClusterNotFound describes a response with status code 404, with default header values. - -Cluster not found -*/ -type GetClusterNotFound struct { -} - -// IsSuccess returns true when this get cluster not found response has a 2xx status code -func (o *GetClusterNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this get cluster not found response has a 3xx status code -func (o *GetClusterNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get cluster not found response has a 4xx status code -func (o *GetClusterNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this get cluster not found response has a 5xx status code -func (o *GetClusterNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this get cluster not found response a status code equal to that given -func (o *GetClusterNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the get cluster not found response -func (o *GetClusterNotFound) Code() int { - return 404 -} - -func (o *GetClusterNotFound) Error() string { - return fmt.Sprintf("[GET /kubernetes-clusters/{cluster_id}][%d] getClusterNotFound", 404) -} - -func (o *GetClusterNotFound) String() string { - return fmt.Sprintf("[GET /kubernetes-clusters/{cluster_id}][%d] getClusterNotFound", 404) -} - -func (o *GetClusterNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewGetClusterInternalServerError creates a GetClusterInternalServerError with default headers values -func NewGetClusterInternalServerError() *GetClusterInternalServerError { - return &GetClusterInternalServerError{} -} - -/* -GetClusterInternalServerError describes a response with status code 500, with default header values. - -Unexpected error -*/ -type GetClusterInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this get cluster internal server error response has a 2xx status code -func (o *GetClusterInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this get cluster internal server error response has a 3xx status code -func (o *GetClusterInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get cluster internal server error response has a 4xx status code -func (o *GetClusterInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this get cluster internal server error response has a 5xx status code -func (o *GetClusterInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this get cluster internal server error response a status code equal to that given -func (o *GetClusterInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the get cluster internal server error response -func (o *GetClusterInternalServerError) Code() int { - return 500 -} - -func (o *GetClusterInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /kubernetes-clusters/{cluster_id}][%d] getClusterInternalServerError %s", 500, payload) -} - -func (o *GetClusterInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /kubernetes-clusters/{cluster_id}][%d] getClusterInternalServerError %s", 500, payload) -} - -func (o *GetClusterInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetClusterInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/cluster-registry/client/clusters/list_clusters_parameters.go b/pkg/cluster-registry/client/clusters/list_clusters_parameters.go deleted file mode 100644 index 62cd6f9f..00000000 --- a/pkg/cluster-registry/client/clusters/list_clusters_parameters.go +++ /dev/null @@ -1,553 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package clusters - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListClustersParams creates a new ListClustersParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListClustersParams() *ListClustersParams { - return &ListClustersParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListClustersParamsWithTimeout creates a new ListClustersParams object -// with the ability to set a timeout on a request. -func NewListClustersParamsWithTimeout(timeout time.Duration) *ListClustersParams { - return &ListClustersParams{ - timeout: timeout, - } -} - -// NewListClustersParamsWithContext creates a new ListClustersParams object -// with the ability to set a context for a request. -func NewListClustersParamsWithContext(ctx context.Context) *ListClustersParams { - return &ListClustersParams{ - Context: ctx, - } -} - -// NewListClustersParamsWithHTTPClient creates a new ListClustersParams object -// with the ability to set a custom HTTPClient for a request. -func NewListClustersParamsWithHTTPClient(client *http.Client) *ListClustersParams { - return &ListClustersParams{ - HTTPClient: client, - } -} - -/* -ListClustersParams contains all the parameters to send to the API endpoint - - for the list clusters operation. - - Typically these are written to a http.Request. -*/ -type ListClustersParams struct { - - /* Alias. - - Filter on cluster alias. - */ - Alias *string - - /* APIServerURL. - - Filter on API server URL. - */ - APIServerURL *string - - /* Channel. - - Filter on channel. - */ - Channel *string - - /* CostCenter. - - Filter on cost center number. - */ - CostCenter *string - - /* CriticalityLevel. - - Filter on criticality level. - - Format: int32 - */ - CriticalityLevel *int32 - - /* Environment. - - Filter on environment. - */ - Environment *string - - /* InfrastructureAccount. - - Filter on infrastructure account. - */ - InfrastructureAccount *string - - /* LifecycleStatus. - - Filter on cluster lifecycle status. - */ - LifecycleStatus *string - - /* LocalID. - - Filter on local id. - */ - LocalID *string - - /* Provider. - - Filter on provider. - */ - Provider *string - - /* Region. - - Filter on region. - */ - Region *string - - /* Verbose. - - Include technical data (config items, node pools) in the response, true by default - - Default: true - */ - Verbose *bool - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list clusters params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListClustersParams) WithDefaults() *ListClustersParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list clusters params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListClustersParams) SetDefaults() { - var ( - verboseDefault = bool(true) - ) - - val := ListClustersParams{ - Verbose: &verboseDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the list clusters params -func (o *ListClustersParams) WithTimeout(timeout time.Duration) *ListClustersParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list clusters params -func (o *ListClustersParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list clusters params -func (o *ListClustersParams) WithContext(ctx context.Context) *ListClustersParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list clusters params -func (o *ListClustersParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list clusters params -func (o *ListClustersParams) WithHTTPClient(client *http.Client) *ListClustersParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list clusters params -func (o *ListClustersParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithAlias adds the alias to the list clusters params -func (o *ListClustersParams) WithAlias(alias *string) *ListClustersParams { - o.SetAlias(alias) - return o -} - -// SetAlias adds the alias to the list clusters params -func (o *ListClustersParams) SetAlias(alias *string) { - o.Alias = alias -} - -// WithAPIServerURL adds the aPIServerURL to the list clusters params -func (o *ListClustersParams) WithAPIServerURL(aPIServerURL *string) *ListClustersParams { - o.SetAPIServerURL(aPIServerURL) - return o -} - -// SetAPIServerURL adds the apiServerUrl to the list clusters params -func (o *ListClustersParams) SetAPIServerURL(aPIServerURL *string) { - o.APIServerURL = aPIServerURL -} - -// WithChannel adds the channel to the list clusters params -func (o *ListClustersParams) WithChannel(channel *string) *ListClustersParams { - o.SetChannel(channel) - return o -} - -// SetChannel adds the channel to the list clusters params -func (o *ListClustersParams) SetChannel(channel *string) { - o.Channel = channel -} - -// WithCostCenter adds the costCenter to the list clusters params -func (o *ListClustersParams) WithCostCenter(costCenter *string) *ListClustersParams { - o.SetCostCenter(costCenter) - return o -} - -// SetCostCenter adds the costCenter to the list clusters params -func (o *ListClustersParams) SetCostCenter(costCenter *string) { - o.CostCenter = costCenter -} - -// WithCriticalityLevel adds the criticalityLevel to the list clusters params -func (o *ListClustersParams) WithCriticalityLevel(criticalityLevel *int32) *ListClustersParams { - o.SetCriticalityLevel(criticalityLevel) - return o -} - -// SetCriticalityLevel adds the criticalityLevel to the list clusters params -func (o *ListClustersParams) SetCriticalityLevel(criticalityLevel *int32) { - o.CriticalityLevel = criticalityLevel -} - -// WithEnvironment adds the environment to the list clusters params -func (o *ListClustersParams) WithEnvironment(environment *string) *ListClustersParams { - o.SetEnvironment(environment) - return o -} - -// SetEnvironment adds the environment to the list clusters params -func (o *ListClustersParams) SetEnvironment(environment *string) { - o.Environment = environment -} - -// WithInfrastructureAccount adds the infrastructureAccount to the list clusters params -func (o *ListClustersParams) WithInfrastructureAccount(infrastructureAccount *string) *ListClustersParams { - o.SetInfrastructureAccount(infrastructureAccount) - return o -} - -// SetInfrastructureAccount adds the infrastructureAccount to the list clusters params -func (o *ListClustersParams) SetInfrastructureAccount(infrastructureAccount *string) { - o.InfrastructureAccount = infrastructureAccount -} - -// WithLifecycleStatus adds the lifecycleStatus to the list clusters params -func (o *ListClustersParams) WithLifecycleStatus(lifecycleStatus *string) *ListClustersParams { - o.SetLifecycleStatus(lifecycleStatus) - return o -} - -// SetLifecycleStatus adds the lifecycleStatus to the list clusters params -func (o *ListClustersParams) SetLifecycleStatus(lifecycleStatus *string) { - o.LifecycleStatus = lifecycleStatus -} - -// WithLocalID adds the localID to the list clusters params -func (o *ListClustersParams) WithLocalID(localID *string) *ListClustersParams { - o.SetLocalID(localID) - return o -} - -// SetLocalID adds the localId to the list clusters params -func (o *ListClustersParams) SetLocalID(localID *string) { - o.LocalID = localID -} - -// WithProvider adds the provider to the list clusters params -func (o *ListClustersParams) WithProvider(provider *string) *ListClustersParams { - o.SetProvider(provider) - return o -} - -// SetProvider adds the provider to the list clusters params -func (o *ListClustersParams) SetProvider(provider *string) { - o.Provider = provider -} - -// WithRegion adds the region to the list clusters params -func (o *ListClustersParams) WithRegion(region *string) *ListClustersParams { - o.SetRegion(region) - return o -} - -// SetRegion adds the region to the list clusters params -func (o *ListClustersParams) SetRegion(region *string) { - o.Region = region -} - -// WithVerbose adds the verbose to the list clusters params -func (o *ListClustersParams) WithVerbose(verbose *bool) *ListClustersParams { - o.SetVerbose(verbose) - return o -} - -// SetVerbose adds the verbose to the list clusters params -func (o *ListClustersParams) SetVerbose(verbose *bool) { - o.Verbose = verbose -} - -// WriteToRequest writes these params to a swagger request -func (o *ListClustersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Alias != nil { - - // query param alias - var qrAlias string - - if o.Alias != nil { - qrAlias = *o.Alias - } - qAlias := qrAlias - if qAlias != "" { - - if err := r.SetQueryParam("alias", qAlias); err != nil { - return err - } - } - } - - if o.APIServerURL != nil { - - // query param api_server_url - var qrAPIServerURL string - - if o.APIServerURL != nil { - qrAPIServerURL = *o.APIServerURL - } - qAPIServerURL := qrAPIServerURL - if qAPIServerURL != "" { - - if err := r.SetQueryParam("api_server_url", qAPIServerURL); err != nil { - return err - } - } - } - - if o.Channel != nil { - - // query param channel - var qrChannel string - - if o.Channel != nil { - qrChannel = *o.Channel - } - qChannel := qrChannel - if qChannel != "" { - - if err := r.SetQueryParam("channel", qChannel); err != nil { - return err - } - } - } - - if o.CostCenter != nil { - - // query param cost_center - var qrCostCenter string - - if o.CostCenter != nil { - qrCostCenter = *o.CostCenter - } - qCostCenter := qrCostCenter - if qCostCenter != "" { - - if err := r.SetQueryParam("cost_center", qCostCenter); err != nil { - return err - } - } - } - - if o.CriticalityLevel != nil { - - // query param criticality_level - var qrCriticalityLevel int32 - - if o.CriticalityLevel != nil { - qrCriticalityLevel = *o.CriticalityLevel - } - qCriticalityLevel := swag.FormatInt32(qrCriticalityLevel) - if qCriticalityLevel != "" { - - if err := r.SetQueryParam("criticality_level", qCriticalityLevel); err != nil { - return err - } - } - } - - if o.Environment != nil { - - // query param environment - var qrEnvironment string - - if o.Environment != nil { - qrEnvironment = *o.Environment - } - qEnvironment := qrEnvironment - if qEnvironment != "" { - - if err := r.SetQueryParam("environment", qEnvironment); err != nil { - return err - } - } - } - - if o.InfrastructureAccount != nil { - - // query param infrastructure_account - var qrInfrastructureAccount string - - if o.InfrastructureAccount != nil { - qrInfrastructureAccount = *o.InfrastructureAccount - } - qInfrastructureAccount := qrInfrastructureAccount - if qInfrastructureAccount != "" { - - if err := r.SetQueryParam("infrastructure_account", qInfrastructureAccount); err != nil { - return err - } - } - } - - if o.LifecycleStatus != nil { - - // query param lifecycle_status - var qrLifecycleStatus string - - if o.LifecycleStatus != nil { - qrLifecycleStatus = *o.LifecycleStatus - } - qLifecycleStatus := qrLifecycleStatus - if qLifecycleStatus != "" { - - if err := r.SetQueryParam("lifecycle_status", qLifecycleStatus); err != nil { - return err - } - } - } - - if o.LocalID != nil { - - // query param local_id - var qrLocalID string - - if o.LocalID != nil { - qrLocalID = *o.LocalID - } - qLocalID := qrLocalID - if qLocalID != "" { - - if err := r.SetQueryParam("local_id", qLocalID); err != nil { - return err - } - } - } - - if o.Provider != nil { - - // query param provider - var qrProvider string - - if o.Provider != nil { - qrProvider = *o.Provider - } - qProvider := qrProvider - if qProvider != "" { - - if err := r.SetQueryParam("provider", qProvider); err != nil { - return err - } - } - } - - if o.Region != nil { - - // query param region - var qrRegion string - - if o.Region != nil { - qrRegion = *o.Region - } - qRegion := qrRegion - if qRegion != "" { - - if err := r.SetQueryParam("region", qRegion); err != nil { - return err - } - } - } - - if o.Verbose != nil { - - // query param verbose - var qrVerbose bool - - if o.Verbose != nil { - qrVerbose = *o.Verbose - } - qVerbose := swag.FormatBool(qrVerbose) - if qVerbose != "" { - - if err := r.SetQueryParam("verbose", qVerbose); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/cluster-registry/client/clusters/list_clusters_responses.go b/pkg/cluster-registry/client/clusters/list_clusters_responses.go deleted file mode 100644 index e3d75b65..00000000 --- a/pkg/cluster-registry/client/clusters/list_clusters_responses.go +++ /dev/null @@ -1,417 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package clusters - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - "fmt" - "io" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/models" -) - -// ListClustersReader is a Reader for the ListClusters structure. -type ListClustersReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListClustersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListClustersOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewListClustersUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewListClustersForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewListClustersInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /kubernetes-clusters] listClusters", response, response.Code()) - } -} - -// NewListClustersOK creates a ListClustersOK with default headers values -func NewListClustersOK() *ListClustersOK { - return &ListClustersOK{} -} - -/* -ListClustersOK describes a response with status code 200, with default header values. - -List of all Kubernetes clusters. -*/ -type ListClustersOK struct { - Payload *ListClustersOKBody -} - -// IsSuccess returns true when this list clusters o k response has a 2xx status code -func (o *ListClustersOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this list clusters o k response has a 3xx status code -func (o *ListClustersOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list clusters o k response has a 4xx status code -func (o *ListClustersOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this list clusters o k response has a 5xx status code -func (o *ListClustersOK) IsServerError() bool { - return false -} - -// IsCode returns true when this list clusters o k response a status code equal to that given -func (o *ListClustersOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the list clusters o k response -func (o *ListClustersOK) Code() int { - return 200 -} - -func (o *ListClustersOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /kubernetes-clusters][%d] listClustersOK %s", 200, payload) -} - -func (o *ListClustersOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /kubernetes-clusters][%d] listClustersOK %s", 200, payload) -} - -func (o *ListClustersOK) GetPayload() *ListClustersOKBody { - return o.Payload -} - -func (o *ListClustersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(ListClustersOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListClustersUnauthorized creates a ListClustersUnauthorized with default headers values -func NewListClustersUnauthorized() *ListClustersUnauthorized { - return &ListClustersUnauthorized{} -} - -/* -ListClustersUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type ListClustersUnauthorized struct { -} - -// IsSuccess returns true when this list clusters unauthorized response has a 2xx status code -func (o *ListClustersUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this list clusters unauthorized response has a 3xx status code -func (o *ListClustersUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list clusters unauthorized response has a 4xx status code -func (o *ListClustersUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this list clusters unauthorized response has a 5xx status code -func (o *ListClustersUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this list clusters unauthorized response a status code equal to that given -func (o *ListClustersUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the list clusters unauthorized response -func (o *ListClustersUnauthorized) Code() int { - return 401 -} - -func (o *ListClustersUnauthorized) Error() string { - return fmt.Sprintf("[GET /kubernetes-clusters][%d] listClustersUnauthorized", 401) -} - -func (o *ListClustersUnauthorized) String() string { - return fmt.Sprintf("[GET /kubernetes-clusters][%d] listClustersUnauthorized", 401) -} - -func (o *ListClustersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewListClustersForbidden creates a ListClustersForbidden with default headers values -func NewListClustersForbidden() *ListClustersForbidden { - return &ListClustersForbidden{} -} - -/* -ListClustersForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ListClustersForbidden struct { -} - -// IsSuccess returns true when this list clusters forbidden response has a 2xx status code -func (o *ListClustersForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this list clusters forbidden response has a 3xx status code -func (o *ListClustersForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list clusters forbidden response has a 4xx status code -func (o *ListClustersForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this list clusters forbidden response has a 5xx status code -func (o *ListClustersForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this list clusters forbidden response a status code equal to that given -func (o *ListClustersForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the list clusters forbidden response -func (o *ListClustersForbidden) Code() int { - return 403 -} - -func (o *ListClustersForbidden) Error() string { - return fmt.Sprintf("[GET /kubernetes-clusters][%d] listClustersForbidden", 403) -} - -func (o *ListClustersForbidden) String() string { - return fmt.Sprintf("[GET /kubernetes-clusters][%d] listClustersForbidden", 403) -} - -func (o *ListClustersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewListClustersInternalServerError creates a ListClustersInternalServerError with default headers values -func NewListClustersInternalServerError() *ListClustersInternalServerError { - return &ListClustersInternalServerError{} -} - -/* -ListClustersInternalServerError describes a response with status code 500, with default header values. - -Unexpected error -*/ -type ListClustersInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this list clusters internal server error response has a 2xx status code -func (o *ListClustersInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this list clusters internal server error response has a 3xx status code -func (o *ListClustersInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list clusters internal server error response has a 4xx status code -func (o *ListClustersInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this list clusters internal server error response has a 5xx status code -func (o *ListClustersInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this list clusters internal server error response a status code equal to that given -func (o *ListClustersInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the list clusters internal server error response -func (o *ListClustersInternalServerError) Code() int { - return 500 -} - -func (o *ListClustersInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /kubernetes-clusters][%d] listClustersInternalServerError %s", 500, payload) -} - -func (o *ListClustersInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /kubernetes-clusters][%d] listClustersInternalServerError %s", 500, payload) -} - -func (o *ListClustersInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *ListClustersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -ListClustersOKBody list clusters o k body -swagger:model ListClustersOKBody -*/ -type ListClustersOKBody struct { - - // items - Items []*models.Cluster `json:"items"` -} - -// Validate validates this list clusters o k body -func (o *ListClustersOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateItems(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListClustersOKBody) validateItems(formats strfmt.Registry) error { - if swag.IsZero(o.Items) { // not required - return nil - } - - for i := 0; i < len(o.Items); i++ { - if swag.IsZero(o.Items[i]) { // not required - continue - } - - if o.Items[i] != nil { - if err := o.Items[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("listClustersOK" + "." + "items" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("listClustersOK" + "." + "items" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list clusters o k body based on the context it is used -func (o *ListClustersOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateItems(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListClustersOKBody) contextValidateItems(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(o.Items); i++ { - - if o.Items[i] != nil { - - if swag.IsZero(o.Items[i]) { // not required - return nil - } - - if err := o.Items[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("listClustersOK" + "." + "items" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("listClustersOK" + "." + "items" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListClustersOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListClustersOKBody) UnmarshalBinary(b []byte) error { - var res ListClustersOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/pkg/cluster-registry/client/clusters/update_cluster_parameters.go b/pkg/cluster-registry/client/clusters/update_cluster_parameters.go deleted file mode 100644 index ca9341ac..00000000 --- a/pkg/cluster-registry/client/clusters/update_cluster_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package clusters - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/models" -) - -// NewUpdateClusterParams creates a new UpdateClusterParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateClusterParams() *UpdateClusterParams { - return &UpdateClusterParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateClusterParamsWithTimeout creates a new UpdateClusterParams object -// with the ability to set a timeout on a request. -func NewUpdateClusterParamsWithTimeout(timeout time.Duration) *UpdateClusterParams { - return &UpdateClusterParams{ - timeout: timeout, - } -} - -// NewUpdateClusterParamsWithContext creates a new UpdateClusterParams object -// with the ability to set a context for a request. -func NewUpdateClusterParamsWithContext(ctx context.Context) *UpdateClusterParams { - return &UpdateClusterParams{ - Context: ctx, - } -} - -// NewUpdateClusterParamsWithHTTPClient creates a new UpdateClusterParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateClusterParamsWithHTTPClient(client *http.Client) *UpdateClusterParams { - return &UpdateClusterParams{ - HTTPClient: client, - } -} - -/* -UpdateClusterParams contains all the parameters to send to the API endpoint - - for the update cluster operation. - - Typically these are written to a http.Request. -*/ -type UpdateClusterParams struct { - - /* Cluster. - - Cluster that will be updated. - */ - Cluster *models.ClusterUpdate - - /* ClusterID. - - ID of the cluster. - */ - ClusterID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update cluster params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateClusterParams) WithDefaults() *UpdateClusterParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update cluster params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateClusterParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update cluster params -func (o *UpdateClusterParams) WithTimeout(timeout time.Duration) *UpdateClusterParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update cluster params -func (o *UpdateClusterParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update cluster params -func (o *UpdateClusterParams) WithContext(ctx context.Context) *UpdateClusterParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update cluster params -func (o *UpdateClusterParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update cluster params -func (o *UpdateClusterParams) WithHTTPClient(client *http.Client) *UpdateClusterParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update cluster params -func (o *UpdateClusterParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCluster adds the cluster to the update cluster params -func (o *UpdateClusterParams) WithCluster(cluster *models.ClusterUpdate) *UpdateClusterParams { - o.SetCluster(cluster) - return o -} - -// SetCluster adds the cluster to the update cluster params -func (o *UpdateClusterParams) SetCluster(cluster *models.ClusterUpdate) { - o.Cluster = cluster -} - -// WithClusterID adds the clusterID to the update cluster params -func (o *UpdateClusterParams) WithClusterID(clusterID string) *UpdateClusterParams { - o.SetClusterID(clusterID) - return o -} - -// SetClusterID adds the clusterId to the update cluster params -func (o *UpdateClusterParams) SetClusterID(clusterID string) { - o.ClusterID = clusterID -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateClusterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Cluster != nil { - if err := r.SetBodyParam(o.Cluster); err != nil { - return err - } - } - - // path param cluster_id - if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/cluster-registry/client/clusters/update_cluster_responses.go b/pkg/cluster-registry/client/clusters/update_cluster_responses.go deleted file mode 100644 index 4cf703c3..00000000 --- a/pkg/cluster-registry/client/clusters/update_cluster_responses.go +++ /dev/null @@ -1,368 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package clusters - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/models" -) - -// UpdateClusterReader is a Reader for the UpdateCluster structure. -type UpdateClusterReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateClusterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateClusterOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewUpdateClusterUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewUpdateClusterForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateClusterNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewUpdateClusterInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PATCH /kubernetes-clusters/{cluster_id}] updateCluster", response, response.Code()) - } -} - -// NewUpdateClusterOK creates a UpdateClusterOK with default headers values -func NewUpdateClusterOK() *UpdateClusterOK { - return &UpdateClusterOK{} -} - -/* -UpdateClusterOK describes a response with status code 200, with default header values. - -The cluster update request is performed and the updated cluster is returned. -*/ -type UpdateClusterOK struct { - Payload *models.Cluster -} - -// IsSuccess returns true when this update cluster o k response has a 2xx status code -func (o *UpdateClusterOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this update cluster o k response has a 3xx status code -func (o *UpdateClusterOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update cluster o k response has a 4xx status code -func (o *UpdateClusterOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this update cluster o k response has a 5xx status code -func (o *UpdateClusterOK) IsServerError() bool { - return false -} - -// IsCode returns true when this update cluster o k response a status code equal to that given -func (o *UpdateClusterOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the update cluster o k response -func (o *UpdateClusterOK) Code() int { - return 200 -} - -func (o *UpdateClusterOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PATCH /kubernetes-clusters/{cluster_id}][%d] updateClusterOK %s", 200, payload) -} - -func (o *UpdateClusterOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PATCH /kubernetes-clusters/{cluster_id}][%d] updateClusterOK %s", 200, payload) -} - -func (o *UpdateClusterOK) GetPayload() *models.Cluster { - return o.Payload -} - -func (o *UpdateClusterOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Cluster) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateClusterUnauthorized creates a UpdateClusterUnauthorized with default headers values -func NewUpdateClusterUnauthorized() *UpdateClusterUnauthorized { - return &UpdateClusterUnauthorized{} -} - -/* -UpdateClusterUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type UpdateClusterUnauthorized struct { -} - -// IsSuccess returns true when this update cluster unauthorized response has a 2xx status code -func (o *UpdateClusterUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update cluster unauthorized response has a 3xx status code -func (o *UpdateClusterUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update cluster unauthorized response has a 4xx status code -func (o *UpdateClusterUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this update cluster unauthorized response has a 5xx status code -func (o *UpdateClusterUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this update cluster unauthorized response a status code equal to that given -func (o *UpdateClusterUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the update cluster unauthorized response -func (o *UpdateClusterUnauthorized) Code() int { - return 401 -} - -func (o *UpdateClusterUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /kubernetes-clusters/{cluster_id}][%d] updateClusterUnauthorized", 401) -} - -func (o *UpdateClusterUnauthorized) String() string { - return fmt.Sprintf("[PATCH /kubernetes-clusters/{cluster_id}][%d] updateClusterUnauthorized", 401) -} - -func (o *UpdateClusterUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewUpdateClusterForbidden creates a UpdateClusterForbidden with default headers values -func NewUpdateClusterForbidden() *UpdateClusterForbidden { - return &UpdateClusterForbidden{} -} - -/* -UpdateClusterForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type UpdateClusterForbidden struct { -} - -// IsSuccess returns true when this update cluster forbidden response has a 2xx status code -func (o *UpdateClusterForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update cluster forbidden response has a 3xx status code -func (o *UpdateClusterForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update cluster forbidden response has a 4xx status code -func (o *UpdateClusterForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this update cluster forbidden response has a 5xx status code -func (o *UpdateClusterForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this update cluster forbidden response a status code equal to that given -func (o *UpdateClusterForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the update cluster forbidden response -func (o *UpdateClusterForbidden) Code() int { - return 403 -} - -func (o *UpdateClusterForbidden) Error() string { - return fmt.Sprintf("[PATCH /kubernetes-clusters/{cluster_id}][%d] updateClusterForbidden", 403) -} - -func (o *UpdateClusterForbidden) String() string { - return fmt.Sprintf("[PATCH /kubernetes-clusters/{cluster_id}][%d] updateClusterForbidden", 403) -} - -func (o *UpdateClusterForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewUpdateClusterNotFound creates a UpdateClusterNotFound with default headers values -func NewUpdateClusterNotFound() *UpdateClusterNotFound { - return &UpdateClusterNotFound{} -} - -/* -UpdateClusterNotFound describes a response with status code 404, with default header values. - -Cluster not found -*/ -type UpdateClusterNotFound struct { -} - -// IsSuccess returns true when this update cluster not found response has a 2xx status code -func (o *UpdateClusterNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update cluster not found response has a 3xx status code -func (o *UpdateClusterNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update cluster not found response has a 4xx status code -func (o *UpdateClusterNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this update cluster not found response has a 5xx status code -func (o *UpdateClusterNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this update cluster not found response a status code equal to that given -func (o *UpdateClusterNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the update cluster not found response -func (o *UpdateClusterNotFound) Code() int { - return 404 -} - -func (o *UpdateClusterNotFound) Error() string { - return fmt.Sprintf("[PATCH /kubernetes-clusters/{cluster_id}][%d] updateClusterNotFound", 404) -} - -func (o *UpdateClusterNotFound) String() string { - return fmt.Sprintf("[PATCH /kubernetes-clusters/{cluster_id}][%d] updateClusterNotFound", 404) -} - -func (o *UpdateClusterNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewUpdateClusterInternalServerError creates a UpdateClusterInternalServerError with default headers values -func NewUpdateClusterInternalServerError() *UpdateClusterInternalServerError { - return &UpdateClusterInternalServerError{} -} - -/* -UpdateClusterInternalServerError describes a response with status code 500, with default header values. - -Unexpected error -*/ -type UpdateClusterInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this update cluster internal server error response has a 2xx status code -func (o *UpdateClusterInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update cluster internal server error response has a 3xx status code -func (o *UpdateClusterInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update cluster internal server error response has a 4xx status code -func (o *UpdateClusterInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this update cluster internal server error response has a 5xx status code -func (o *UpdateClusterInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this update cluster internal server error response a status code equal to that given -func (o *UpdateClusterInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the update cluster internal server error response -func (o *UpdateClusterInternalServerError) Code() int { - return 500 -} - -func (o *UpdateClusterInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PATCH /kubernetes-clusters/{cluster_id}][%d] updateClusterInternalServerError %s", 500, payload) -} - -func (o *UpdateClusterInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PATCH /kubernetes-clusters/{cluster_id}][%d] updateClusterInternalServerError %s", 500, payload) -} - -func (o *UpdateClusterInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateClusterInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/cluster-registry/client/config_items/add_or_update_config_item_parameters.go b/pkg/cluster-registry/client/config_items/add_or_update_config_item_parameters.go deleted file mode 100644 index b8455c78..00000000 --- a/pkg/cluster-registry/client/config_items/add_or_update_config_item_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package config_items - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/models" -) - -// NewAddOrUpdateConfigItemParams creates a new AddOrUpdateConfigItemParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewAddOrUpdateConfigItemParams() *AddOrUpdateConfigItemParams { - return &AddOrUpdateConfigItemParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewAddOrUpdateConfigItemParamsWithTimeout creates a new AddOrUpdateConfigItemParams object -// with the ability to set a timeout on a request. -func NewAddOrUpdateConfigItemParamsWithTimeout(timeout time.Duration) *AddOrUpdateConfigItemParams { - return &AddOrUpdateConfigItemParams{ - timeout: timeout, - } -} - -// NewAddOrUpdateConfigItemParamsWithContext creates a new AddOrUpdateConfigItemParams object -// with the ability to set a context for a request. -func NewAddOrUpdateConfigItemParamsWithContext(ctx context.Context) *AddOrUpdateConfigItemParams { - return &AddOrUpdateConfigItemParams{ - Context: ctx, - } -} - -// NewAddOrUpdateConfigItemParamsWithHTTPClient creates a new AddOrUpdateConfigItemParams object -// with the ability to set a custom HTTPClient for a request. -func NewAddOrUpdateConfigItemParamsWithHTTPClient(client *http.Client) *AddOrUpdateConfigItemParams { - return &AddOrUpdateConfigItemParams{ - HTTPClient: client, - } -} - -/* -AddOrUpdateConfigItemParams contains all the parameters to send to the API endpoint - - for the add or update config item operation. - - Typically these are written to a http.Request. -*/ -type AddOrUpdateConfigItemParams struct { - - /* ClusterID. - - ID of the cluster. - */ - ClusterID string - - /* ConfigKey. - - Key for the config value. - */ - ConfigKey string - - /* Value. - - Config value. - */ - Value *models.ConfigValue - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the add or update config item params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AddOrUpdateConfigItemParams) WithDefaults() *AddOrUpdateConfigItemParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the add or update config item params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AddOrUpdateConfigItemParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the add or update config item params -func (o *AddOrUpdateConfigItemParams) WithTimeout(timeout time.Duration) *AddOrUpdateConfigItemParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the add or update config item params -func (o *AddOrUpdateConfigItemParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the add or update config item params -func (o *AddOrUpdateConfigItemParams) WithContext(ctx context.Context) *AddOrUpdateConfigItemParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the add or update config item params -func (o *AddOrUpdateConfigItemParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the add or update config item params -func (o *AddOrUpdateConfigItemParams) WithHTTPClient(client *http.Client) *AddOrUpdateConfigItemParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the add or update config item params -func (o *AddOrUpdateConfigItemParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithClusterID adds the clusterID to the add or update config item params -func (o *AddOrUpdateConfigItemParams) WithClusterID(clusterID string) *AddOrUpdateConfigItemParams { - o.SetClusterID(clusterID) - return o -} - -// SetClusterID adds the clusterId to the add or update config item params -func (o *AddOrUpdateConfigItemParams) SetClusterID(clusterID string) { - o.ClusterID = clusterID -} - -// WithConfigKey adds the configKey to the add or update config item params -func (o *AddOrUpdateConfigItemParams) WithConfigKey(configKey string) *AddOrUpdateConfigItemParams { - o.SetConfigKey(configKey) - return o -} - -// SetConfigKey adds the configKey to the add or update config item params -func (o *AddOrUpdateConfigItemParams) SetConfigKey(configKey string) { - o.ConfigKey = configKey -} - -// WithValue adds the value to the add or update config item params -func (o *AddOrUpdateConfigItemParams) WithValue(value *models.ConfigValue) *AddOrUpdateConfigItemParams { - o.SetValue(value) - return o -} - -// SetValue adds the value to the add or update config item params -func (o *AddOrUpdateConfigItemParams) SetValue(value *models.ConfigValue) { - o.Value = value -} - -// WriteToRequest writes these params to a swagger request -func (o *AddOrUpdateConfigItemParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cluster_id - if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { - return err - } - - // path param config_key - if err := r.SetPathParam("config_key", o.ConfigKey); err != nil { - return err - } - if o.Value != nil { - if err := r.SetBodyParam(o.Value); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/cluster-registry/client/config_items/add_or_update_config_item_responses.go b/pkg/cluster-registry/client/config_items/add_or_update_config_item_responses.go deleted file mode 100644 index 63f9a96a..00000000 --- a/pkg/cluster-registry/client/config_items/add_or_update_config_item_responses.go +++ /dev/null @@ -1,382 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package config_items - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/models" -) - -// AddOrUpdateConfigItemReader is a Reader for the AddOrUpdateConfigItem structure. -type AddOrUpdateConfigItemReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *AddOrUpdateConfigItemReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewAddOrUpdateConfigItemOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewAddOrUpdateConfigItemBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewAddOrUpdateConfigItemUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewAddOrUpdateConfigItemForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewAddOrUpdateConfigItemInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /kubernetes-clusters/{cluster_id}/config-items/{config_key}] addOrUpdateConfigItem", response, response.Code()) - } -} - -// NewAddOrUpdateConfigItemOK creates a AddOrUpdateConfigItemOK with default headers values -func NewAddOrUpdateConfigItemOK() *AddOrUpdateConfigItemOK { - return &AddOrUpdateConfigItemOK{} -} - -/* -AddOrUpdateConfigItemOK describes a response with status code 200, with default header values. - -The config items add/update request is accepted. -*/ -type AddOrUpdateConfigItemOK struct { - Payload *models.ConfigValue -} - -// IsSuccess returns true when this add or update config item o k response has a 2xx status code -func (o *AddOrUpdateConfigItemOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this add or update config item o k response has a 3xx status code -func (o *AddOrUpdateConfigItemOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this add or update config item o k response has a 4xx status code -func (o *AddOrUpdateConfigItemOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this add or update config item o k response has a 5xx status code -func (o *AddOrUpdateConfigItemOK) IsServerError() bool { - return false -} - -// IsCode returns true when this add or update config item o k response a status code equal to that given -func (o *AddOrUpdateConfigItemOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the add or update config item o k response -func (o *AddOrUpdateConfigItemOK) Code() int { - return 200 -} - -func (o *AddOrUpdateConfigItemOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /kubernetes-clusters/{cluster_id}/config-items/{config_key}][%d] addOrUpdateConfigItemOK %s", 200, payload) -} - -func (o *AddOrUpdateConfigItemOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /kubernetes-clusters/{cluster_id}/config-items/{config_key}][%d] addOrUpdateConfigItemOK %s", 200, payload) -} - -func (o *AddOrUpdateConfigItemOK) GetPayload() *models.ConfigValue { - return o.Payload -} - -func (o *AddOrUpdateConfigItemOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ConfigValue) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewAddOrUpdateConfigItemBadRequest creates a AddOrUpdateConfigItemBadRequest with default headers values -func NewAddOrUpdateConfigItemBadRequest() *AddOrUpdateConfigItemBadRequest { - return &AddOrUpdateConfigItemBadRequest{} -} - -/* -AddOrUpdateConfigItemBadRequest describes a response with status code 400, with default header values. - -Invalid request -*/ -type AddOrUpdateConfigItemBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this add or update config item bad request response has a 2xx status code -func (o *AddOrUpdateConfigItemBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this add or update config item bad request response has a 3xx status code -func (o *AddOrUpdateConfigItemBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this add or update config item bad request response has a 4xx status code -func (o *AddOrUpdateConfigItemBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this add or update config item bad request response has a 5xx status code -func (o *AddOrUpdateConfigItemBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this add or update config item bad request response a status code equal to that given -func (o *AddOrUpdateConfigItemBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the add or update config item bad request response -func (o *AddOrUpdateConfigItemBadRequest) Code() int { - return 400 -} - -func (o *AddOrUpdateConfigItemBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /kubernetes-clusters/{cluster_id}/config-items/{config_key}][%d] addOrUpdateConfigItemBadRequest %s", 400, payload) -} - -func (o *AddOrUpdateConfigItemBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /kubernetes-clusters/{cluster_id}/config-items/{config_key}][%d] addOrUpdateConfigItemBadRequest %s", 400, payload) -} - -func (o *AddOrUpdateConfigItemBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *AddOrUpdateConfigItemBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewAddOrUpdateConfigItemUnauthorized creates a AddOrUpdateConfigItemUnauthorized with default headers values -func NewAddOrUpdateConfigItemUnauthorized() *AddOrUpdateConfigItemUnauthorized { - return &AddOrUpdateConfigItemUnauthorized{} -} - -/* -AddOrUpdateConfigItemUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type AddOrUpdateConfigItemUnauthorized struct { -} - -// IsSuccess returns true when this add or update config item unauthorized response has a 2xx status code -func (o *AddOrUpdateConfigItemUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this add or update config item unauthorized response has a 3xx status code -func (o *AddOrUpdateConfigItemUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this add or update config item unauthorized response has a 4xx status code -func (o *AddOrUpdateConfigItemUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this add or update config item unauthorized response has a 5xx status code -func (o *AddOrUpdateConfigItemUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this add or update config item unauthorized response a status code equal to that given -func (o *AddOrUpdateConfigItemUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the add or update config item unauthorized response -func (o *AddOrUpdateConfigItemUnauthorized) Code() int { - return 401 -} - -func (o *AddOrUpdateConfigItemUnauthorized) Error() string { - return fmt.Sprintf("[PUT /kubernetes-clusters/{cluster_id}/config-items/{config_key}][%d] addOrUpdateConfigItemUnauthorized", 401) -} - -func (o *AddOrUpdateConfigItemUnauthorized) String() string { - return fmt.Sprintf("[PUT /kubernetes-clusters/{cluster_id}/config-items/{config_key}][%d] addOrUpdateConfigItemUnauthorized", 401) -} - -func (o *AddOrUpdateConfigItemUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewAddOrUpdateConfigItemForbidden creates a AddOrUpdateConfigItemForbidden with default headers values -func NewAddOrUpdateConfigItemForbidden() *AddOrUpdateConfigItemForbidden { - return &AddOrUpdateConfigItemForbidden{} -} - -/* -AddOrUpdateConfigItemForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type AddOrUpdateConfigItemForbidden struct { -} - -// IsSuccess returns true when this add or update config item forbidden response has a 2xx status code -func (o *AddOrUpdateConfigItemForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this add or update config item forbidden response has a 3xx status code -func (o *AddOrUpdateConfigItemForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this add or update config item forbidden response has a 4xx status code -func (o *AddOrUpdateConfigItemForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this add or update config item forbidden response has a 5xx status code -func (o *AddOrUpdateConfigItemForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this add or update config item forbidden response a status code equal to that given -func (o *AddOrUpdateConfigItemForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the add or update config item forbidden response -func (o *AddOrUpdateConfigItemForbidden) Code() int { - return 403 -} - -func (o *AddOrUpdateConfigItemForbidden) Error() string { - return fmt.Sprintf("[PUT /kubernetes-clusters/{cluster_id}/config-items/{config_key}][%d] addOrUpdateConfigItemForbidden", 403) -} - -func (o *AddOrUpdateConfigItemForbidden) String() string { - return fmt.Sprintf("[PUT /kubernetes-clusters/{cluster_id}/config-items/{config_key}][%d] addOrUpdateConfigItemForbidden", 403) -} - -func (o *AddOrUpdateConfigItemForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewAddOrUpdateConfigItemInternalServerError creates a AddOrUpdateConfigItemInternalServerError with default headers values -func NewAddOrUpdateConfigItemInternalServerError() *AddOrUpdateConfigItemInternalServerError { - return &AddOrUpdateConfigItemInternalServerError{} -} - -/* -AddOrUpdateConfigItemInternalServerError describes a response with status code 500, with default header values. - -Unexpected error -*/ -type AddOrUpdateConfigItemInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this add or update config item internal server error response has a 2xx status code -func (o *AddOrUpdateConfigItemInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this add or update config item internal server error response has a 3xx status code -func (o *AddOrUpdateConfigItemInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this add or update config item internal server error response has a 4xx status code -func (o *AddOrUpdateConfigItemInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this add or update config item internal server error response has a 5xx status code -func (o *AddOrUpdateConfigItemInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this add or update config item internal server error response a status code equal to that given -func (o *AddOrUpdateConfigItemInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the add or update config item internal server error response -func (o *AddOrUpdateConfigItemInternalServerError) Code() int { - return 500 -} - -func (o *AddOrUpdateConfigItemInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /kubernetes-clusters/{cluster_id}/config-items/{config_key}][%d] addOrUpdateConfigItemInternalServerError %s", 500, payload) -} - -func (o *AddOrUpdateConfigItemInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /kubernetes-clusters/{cluster_id}/config-items/{config_key}][%d] addOrUpdateConfigItemInternalServerError %s", 500, payload) -} - -func (o *AddOrUpdateConfigItemInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *AddOrUpdateConfigItemInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/cluster-registry/client/config_items/config_items_client.go b/pkg/cluster-registry/client/config_items/config_items_client.go deleted file mode 100644 index b2925cdc..00000000 --- a/pkg/cluster-registry/client/config_items/config_items_client.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package config_items - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new config items API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new config items API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new config items API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for config items API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - AddOrUpdateConfigItem(params *AddOrUpdateConfigItemParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AddOrUpdateConfigItemOK, error) - - DeleteConfigItem(params *DeleteConfigItemParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteConfigItemNoContent, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -AddOrUpdateConfigItem adds update config item - -Add/update a configuration item unique to the cluster. -*/ -func (a *Client) AddOrUpdateConfigItem(params *AddOrUpdateConfigItemParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AddOrUpdateConfigItemOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewAddOrUpdateConfigItemParams() - } - op := &runtime.ClientOperation{ - ID: "addOrUpdateConfigItem", - Method: "PUT", - PathPattern: "/kubernetes-clusters/{cluster_id}/config-items/{config_key}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &AddOrUpdateConfigItemReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*AddOrUpdateConfigItemOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for addOrUpdateConfigItem: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -DeleteConfigItem deletes config item - -Deletes config item. -*/ -func (a *Client) DeleteConfigItem(params *DeleteConfigItemParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteConfigItemNoContent, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteConfigItemParams() - } - op := &runtime.ClientOperation{ - ID: "deleteConfigItem", - Method: "DELETE", - PathPattern: "/kubernetes-clusters/{cluster_id}/config-items/{config_key}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DeleteConfigItemReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteConfigItemNoContent) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteConfigItem: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/pkg/cluster-registry/client/config_items/delete_config_item_parameters.go b/pkg/cluster-registry/client/config_items/delete_config_item_parameters.go deleted file mode 100644 index 2ac145b1..00000000 --- a/pkg/cluster-registry/client/config_items/delete_config_item_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package config_items - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteConfigItemParams creates a new DeleteConfigItemParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteConfigItemParams() *DeleteConfigItemParams { - return &DeleteConfigItemParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteConfigItemParamsWithTimeout creates a new DeleteConfigItemParams object -// with the ability to set a timeout on a request. -func NewDeleteConfigItemParamsWithTimeout(timeout time.Duration) *DeleteConfigItemParams { - return &DeleteConfigItemParams{ - timeout: timeout, - } -} - -// NewDeleteConfigItemParamsWithContext creates a new DeleteConfigItemParams object -// with the ability to set a context for a request. -func NewDeleteConfigItemParamsWithContext(ctx context.Context) *DeleteConfigItemParams { - return &DeleteConfigItemParams{ - Context: ctx, - } -} - -// NewDeleteConfigItemParamsWithHTTPClient creates a new DeleteConfigItemParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteConfigItemParamsWithHTTPClient(client *http.Client) *DeleteConfigItemParams { - return &DeleteConfigItemParams{ - HTTPClient: client, - } -} - -/* -DeleteConfigItemParams contains all the parameters to send to the API endpoint - - for the delete config item operation. - - Typically these are written to a http.Request. -*/ -type DeleteConfigItemParams struct { - - /* ClusterID. - - ID of the cluster. - */ - ClusterID string - - /* ConfigKey. - - Key for the config value. - */ - ConfigKey string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete config item params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteConfigItemParams) WithDefaults() *DeleteConfigItemParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete config item params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteConfigItemParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete config item params -func (o *DeleteConfigItemParams) WithTimeout(timeout time.Duration) *DeleteConfigItemParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete config item params -func (o *DeleteConfigItemParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete config item params -func (o *DeleteConfigItemParams) WithContext(ctx context.Context) *DeleteConfigItemParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete config item params -func (o *DeleteConfigItemParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete config item params -func (o *DeleteConfigItemParams) WithHTTPClient(client *http.Client) *DeleteConfigItemParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete config item params -func (o *DeleteConfigItemParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithClusterID adds the clusterID to the delete config item params -func (o *DeleteConfigItemParams) WithClusterID(clusterID string) *DeleteConfigItemParams { - o.SetClusterID(clusterID) - return o -} - -// SetClusterID adds the clusterId to the delete config item params -func (o *DeleteConfigItemParams) SetClusterID(clusterID string) { - o.ClusterID = clusterID -} - -// WithConfigKey adds the configKey to the delete config item params -func (o *DeleteConfigItemParams) WithConfigKey(configKey string) *DeleteConfigItemParams { - o.SetConfigKey(configKey) - return o -} - -// SetConfigKey adds the configKey to the delete config item params -func (o *DeleteConfigItemParams) SetConfigKey(configKey string) { - o.ConfigKey = configKey -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteConfigItemParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cluster_id - if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { - return err - } - - // path param config_key - if err := r.SetPathParam("config_key", o.ConfigKey); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/cluster-registry/client/config_items/delete_config_item_responses.go b/pkg/cluster-registry/client/config_items/delete_config_item_responses.go deleted file mode 100644 index 26857f0a..00000000 --- a/pkg/cluster-registry/client/config_items/delete_config_item_responses.go +++ /dev/null @@ -1,430 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package config_items - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/models" -) - -// DeleteConfigItemReader is a Reader for the DeleteConfigItem structure. -type DeleteConfigItemReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteConfigItemReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 204: - result := NewDeleteConfigItemNoContent() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewDeleteConfigItemBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewDeleteConfigItemUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewDeleteConfigItemForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDeleteConfigItemNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewDeleteConfigItemInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /kubernetes-clusters/{cluster_id}/config-items/{config_key}] deleteConfigItem", response, response.Code()) - } -} - -// NewDeleteConfigItemNoContent creates a DeleteConfigItemNoContent with default headers values -func NewDeleteConfigItemNoContent() *DeleteConfigItemNoContent { - return &DeleteConfigItemNoContent{} -} - -/* -DeleteConfigItemNoContent describes a response with status code 204, with default header values. - -Config item deleted. -*/ -type DeleteConfigItemNoContent struct { -} - -// IsSuccess returns true when this delete config item no content response has a 2xx status code -func (o *DeleteConfigItemNoContent) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this delete config item no content response has a 3xx status code -func (o *DeleteConfigItemNoContent) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete config item no content response has a 4xx status code -func (o *DeleteConfigItemNoContent) IsClientError() bool { - return false -} - -// IsServerError returns true when this delete config item no content response has a 5xx status code -func (o *DeleteConfigItemNoContent) IsServerError() bool { - return false -} - -// IsCode returns true when this delete config item no content response a status code equal to that given -func (o *DeleteConfigItemNoContent) IsCode(code int) bool { - return code == 204 -} - -// Code gets the status code for the delete config item no content response -func (o *DeleteConfigItemNoContent) Code() int { - return 204 -} - -func (o *DeleteConfigItemNoContent) Error() string { - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/config-items/{config_key}][%d] deleteConfigItemNoContent", 204) -} - -func (o *DeleteConfigItemNoContent) String() string { - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/config-items/{config_key}][%d] deleteConfigItemNoContent", 204) -} - -func (o *DeleteConfigItemNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewDeleteConfigItemBadRequest creates a DeleteConfigItemBadRequest with default headers values -func NewDeleteConfigItemBadRequest() *DeleteConfigItemBadRequest { - return &DeleteConfigItemBadRequest{} -} - -/* -DeleteConfigItemBadRequest describes a response with status code 400, with default header values. - -Invalid request -*/ -type DeleteConfigItemBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this delete config item bad request response has a 2xx status code -func (o *DeleteConfigItemBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this delete config item bad request response has a 3xx status code -func (o *DeleteConfigItemBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete config item bad request response has a 4xx status code -func (o *DeleteConfigItemBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this delete config item bad request response has a 5xx status code -func (o *DeleteConfigItemBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this delete config item bad request response a status code equal to that given -func (o *DeleteConfigItemBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the delete config item bad request response -func (o *DeleteConfigItemBadRequest) Code() int { - return 400 -} - -func (o *DeleteConfigItemBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/config-items/{config_key}][%d] deleteConfigItemBadRequest %s", 400, payload) -} - -func (o *DeleteConfigItemBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/config-items/{config_key}][%d] deleteConfigItemBadRequest %s", 400, payload) -} - -func (o *DeleteConfigItemBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *DeleteConfigItemBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteConfigItemUnauthorized creates a DeleteConfigItemUnauthorized with default headers values -func NewDeleteConfigItemUnauthorized() *DeleteConfigItemUnauthorized { - return &DeleteConfigItemUnauthorized{} -} - -/* -DeleteConfigItemUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type DeleteConfigItemUnauthorized struct { -} - -// IsSuccess returns true when this delete config item unauthorized response has a 2xx status code -func (o *DeleteConfigItemUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this delete config item unauthorized response has a 3xx status code -func (o *DeleteConfigItemUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete config item unauthorized response has a 4xx status code -func (o *DeleteConfigItemUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this delete config item unauthorized response has a 5xx status code -func (o *DeleteConfigItemUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this delete config item unauthorized response a status code equal to that given -func (o *DeleteConfigItemUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the delete config item unauthorized response -func (o *DeleteConfigItemUnauthorized) Code() int { - return 401 -} - -func (o *DeleteConfigItemUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/config-items/{config_key}][%d] deleteConfigItemUnauthorized", 401) -} - -func (o *DeleteConfigItemUnauthorized) String() string { - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/config-items/{config_key}][%d] deleteConfigItemUnauthorized", 401) -} - -func (o *DeleteConfigItemUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewDeleteConfigItemForbidden creates a DeleteConfigItemForbidden with default headers values -func NewDeleteConfigItemForbidden() *DeleteConfigItemForbidden { - return &DeleteConfigItemForbidden{} -} - -/* -DeleteConfigItemForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type DeleteConfigItemForbidden struct { -} - -// IsSuccess returns true when this delete config item forbidden response has a 2xx status code -func (o *DeleteConfigItemForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this delete config item forbidden response has a 3xx status code -func (o *DeleteConfigItemForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete config item forbidden response has a 4xx status code -func (o *DeleteConfigItemForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this delete config item forbidden response has a 5xx status code -func (o *DeleteConfigItemForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this delete config item forbidden response a status code equal to that given -func (o *DeleteConfigItemForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the delete config item forbidden response -func (o *DeleteConfigItemForbidden) Code() int { - return 403 -} - -func (o *DeleteConfigItemForbidden) Error() string { - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/config-items/{config_key}][%d] deleteConfigItemForbidden", 403) -} - -func (o *DeleteConfigItemForbidden) String() string { - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/config-items/{config_key}][%d] deleteConfigItemForbidden", 403) -} - -func (o *DeleteConfigItemForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewDeleteConfigItemNotFound creates a DeleteConfigItemNotFound with default headers values -func NewDeleteConfigItemNotFound() *DeleteConfigItemNotFound { - return &DeleteConfigItemNotFound{} -} - -/* -DeleteConfigItemNotFound describes a response with status code 404, with default header values. - -Config item not found -*/ -type DeleteConfigItemNotFound struct { -} - -// IsSuccess returns true when this delete config item not found response has a 2xx status code -func (o *DeleteConfigItemNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this delete config item not found response has a 3xx status code -func (o *DeleteConfigItemNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete config item not found response has a 4xx status code -func (o *DeleteConfigItemNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this delete config item not found response has a 5xx status code -func (o *DeleteConfigItemNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this delete config item not found response a status code equal to that given -func (o *DeleteConfigItemNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the delete config item not found response -func (o *DeleteConfigItemNotFound) Code() int { - return 404 -} - -func (o *DeleteConfigItemNotFound) Error() string { - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/config-items/{config_key}][%d] deleteConfigItemNotFound", 404) -} - -func (o *DeleteConfigItemNotFound) String() string { - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/config-items/{config_key}][%d] deleteConfigItemNotFound", 404) -} - -func (o *DeleteConfigItemNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewDeleteConfigItemInternalServerError creates a DeleteConfigItemInternalServerError with default headers values -func NewDeleteConfigItemInternalServerError() *DeleteConfigItemInternalServerError { - return &DeleteConfigItemInternalServerError{} -} - -/* -DeleteConfigItemInternalServerError describes a response with status code 500, with default header values. - -Unexpected error -*/ -type DeleteConfigItemInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this delete config item internal server error response has a 2xx status code -func (o *DeleteConfigItemInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this delete config item internal server error response has a 3xx status code -func (o *DeleteConfigItemInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete config item internal server error response has a 4xx status code -func (o *DeleteConfigItemInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this delete config item internal server error response has a 5xx status code -func (o *DeleteConfigItemInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this delete config item internal server error response a status code equal to that given -func (o *DeleteConfigItemInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the delete config item internal server error response -func (o *DeleteConfigItemInternalServerError) Code() int { - return 500 -} - -func (o *DeleteConfigItemInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/config-items/{config_key}][%d] deleteConfigItemInternalServerError %s", 500, payload) -} - -func (o *DeleteConfigItemInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/config-items/{config_key}][%d] deleteConfigItemInternalServerError %s", 500, payload) -} - -func (o *DeleteConfigItemInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *DeleteConfigItemInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/cluster-registry/client/infrastructure_accounts/create_infrastructure_account_parameters.go b/pkg/cluster-registry/client/infrastructure_accounts/create_infrastructure_account_parameters.go deleted file mode 100644 index e2b564b1..00000000 --- a/pkg/cluster-registry/client/infrastructure_accounts/create_infrastructure_account_parameters.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package infrastructure_accounts - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/models" -) - -// NewCreateInfrastructureAccountParams creates a new CreateInfrastructureAccountParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateInfrastructureAccountParams() *CreateInfrastructureAccountParams { - return &CreateInfrastructureAccountParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateInfrastructureAccountParamsWithTimeout creates a new CreateInfrastructureAccountParams object -// with the ability to set a timeout on a request. -func NewCreateInfrastructureAccountParamsWithTimeout(timeout time.Duration) *CreateInfrastructureAccountParams { - return &CreateInfrastructureAccountParams{ - timeout: timeout, - } -} - -// NewCreateInfrastructureAccountParamsWithContext creates a new CreateInfrastructureAccountParams object -// with the ability to set a context for a request. -func NewCreateInfrastructureAccountParamsWithContext(ctx context.Context) *CreateInfrastructureAccountParams { - return &CreateInfrastructureAccountParams{ - Context: ctx, - } -} - -// NewCreateInfrastructureAccountParamsWithHTTPClient creates a new CreateInfrastructureAccountParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateInfrastructureAccountParamsWithHTTPClient(client *http.Client) *CreateInfrastructureAccountParams { - return &CreateInfrastructureAccountParams{ - HTTPClient: client, - } -} - -/* -CreateInfrastructureAccountParams contains all the parameters to send to the API endpoint - - for the create infrastructure account operation. - - Typically these are written to a http.Request. -*/ -type CreateInfrastructureAccountParams struct { - - /* InfrastructureAccount. - - Account that will be created. - */ - InfrastructureAccount *models.InfrastructureAccount - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create infrastructure account params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateInfrastructureAccountParams) WithDefaults() *CreateInfrastructureAccountParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create infrastructure account params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateInfrastructureAccountParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create infrastructure account params -func (o *CreateInfrastructureAccountParams) WithTimeout(timeout time.Duration) *CreateInfrastructureAccountParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create infrastructure account params -func (o *CreateInfrastructureAccountParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create infrastructure account params -func (o *CreateInfrastructureAccountParams) WithContext(ctx context.Context) *CreateInfrastructureAccountParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create infrastructure account params -func (o *CreateInfrastructureAccountParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create infrastructure account params -func (o *CreateInfrastructureAccountParams) WithHTTPClient(client *http.Client) *CreateInfrastructureAccountParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create infrastructure account params -func (o *CreateInfrastructureAccountParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithInfrastructureAccount adds the infrastructureAccount to the create infrastructure account params -func (o *CreateInfrastructureAccountParams) WithInfrastructureAccount(infrastructureAccount *models.InfrastructureAccount) *CreateInfrastructureAccountParams { - o.SetInfrastructureAccount(infrastructureAccount) - return o -} - -// SetInfrastructureAccount adds the infrastructureAccount to the create infrastructure account params -func (o *CreateInfrastructureAccountParams) SetInfrastructureAccount(infrastructureAccount *models.InfrastructureAccount) { - o.InfrastructureAccount = infrastructureAccount -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateInfrastructureAccountParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.InfrastructureAccount != nil { - if err := r.SetBodyParam(o.InfrastructureAccount); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/cluster-registry/client/infrastructure_accounts/create_infrastructure_account_responses.go b/pkg/cluster-registry/client/infrastructure_accounts/create_infrastructure_account_responses.go deleted file mode 100644 index 967a780a..00000000 --- a/pkg/cluster-registry/client/infrastructure_accounts/create_infrastructure_account_responses.go +++ /dev/null @@ -1,430 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package infrastructure_accounts - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/models" -) - -// CreateInfrastructureAccountReader is a Reader for the CreateInfrastructureAccount structure. -type CreateInfrastructureAccountReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateInfrastructureAccountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreateInfrastructureAccountCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateInfrastructureAccountBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreateInfrastructureAccountUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewCreateInfrastructureAccountForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewCreateInfrastructureAccountConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewCreateInfrastructureAccountInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /infrastructure-accounts] createInfrastructureAccount", response, response.Code()) - } -} - -// NewCreateInfrastructureAccountCreated creates a CreateInfrastructureAccountCreated with default headers values -func NewCreateInfrastructureAccountCreated() *CreateInfrastructureAccountCreated { - return &CreateInfrastructureAccountCreated{} -} - -/* -CreateInfrastructureAccountCreated describes a response with status code 201, with default header values. - -Infrastructure account was scheduled for creation. -*/ -type CreateInfrastructureAccountCreated struct { - Payload *models.InfrastructureAccount -} - -// IsSuccess returns true when this create infrastructure account created response has a 2xx status code -func (o *CreateInfrastructureAccountCreated) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this create infrastructure account created response has a 3xx status code -func (o *CreateInfrastructureAccountCreated) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create infrastructure account created response has a 4xx status code -func (o *CreateInfrastructureAccountCreated) IsClientError() bool { - return false -} - -// IsServerError returns true when this create infrastructure account created response has a 5xx status code -func (o *CreateInfrastructureAccountCreated) IsServerError() bool { - return false -} - -// IsCode returns true when this create infrastructure account created response a status code equal to that given -func (o *CreateInfrastructureAccountCreated) IsCode(code int) bool { - return code == 201 -} - -// Code gets the status code for the create infrastructure account created response -func (o *CreateInfrastructureAccountCreated) Code() int { - return 201 -} - -func (o *CreateInfrastructureAccountCreated) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /infrastructure-accounts][%d] createInfrastructureAccountCreated %s", 201, payload) -} - -func (o *CreateInfrastructureAccountCreated) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /infrastructure-accounts][%d] createInfrastructureAccountCreated %s", 201, payload) -} - -func (o *CreateInfrastructureAccountCreated) GetPayload() *models.InfrastructureAccount { - return o.Payload -} - -func (o *CreateInfrastructureAccountCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.InfrastructureAccount) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateInfrastructureAccountBadRequest creates a CreateInfrastructureAccountBadRequest with default headers values -func NewCreateInfrastructureAccountBadRequest() *CreateInfrastructureAccountBadRequest { - return &CreateInfrastructureAccountBadRequest{} -} - -/* -CreateInfrastructureAccountBadRequest describes a response with status code 400, with default header values. - -Invalid parameters -*/ -type CreateInfrastructureAccountBadRequest struct { -} - -// IsSuccess returns true when this create infrastructure account bad request response has a 2xx status code -func (o *CreateInfrastructureAccountBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create infrastructure account bad request response has a 3xx status code -func (o *CreateInfrastructureAccountBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create infrastructure account bad request response has a 4xx status code -func (o *CreateInfrastructureAccountBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this create infrastructure account bad request response has a 5xx status code -func (o *CreateInfrastructureAccountBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this create infrastructure account bad request response a status code equal to that given -func (o *CreateInfrastructureAccountBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the create infrastructure account bad request response -func (o *CreateInfrastructureAccountBadRequest) Code() int { - return 400 -} - -func (o *CreateInfrastructureAccountBadRequest) Error() string { - return fmt.Sprintf("[POST /infrastructure-accounts][%d] createInfrastructureAccountBadRequest", 400) -} - -func (o *CreateInfrastructureAccountBadRequest) String() string { - return fmt.Sprintf("[POST /infrastructure-accounts][%d] createInfrastructureAccountBadRequest", 400) -} - -func (o *CreateInfrastructureAccountBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewCreateInfrastructureAccountUnauthorized creates a CreateInfrastructureAccountUnauthorized with default headers values -func NewCreateInfrastructureAccountUnauthorized() *CreateInfrastructureAccountUnauthorized { - return &CreateInfrastructureAccountUnauthorized{} -} - -/* -CreateInfrastructureAccountUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type CreateInfrastructureAccountUnauthorized struct { -} - -// IsSuccess returns true when this create infrastructure account unauthorized response has a 2xx status code -func (o *CreateInfrastructureAccountUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create infrastructure account unauthorized response has a 3xx status code -func (o *CreateInfrastructureAccountUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create infrastructure account unauthorized response has a 4xx status code -func (o *CreateInfrastructureAccountUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this create infrastructure account unauthorized response has a 5xx status code -func (o *CreateInfrastructureAccountUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this create infrastructure account unauthorized response a status code equal to that given -func (o *CreateInfrastructureAccountUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the create infrastructure account unauthorized response -func (o *CreateInfrastructureAccountUnauthorized) Code() int { - return 401 -} - -func (o *CreateInfrastructureAccountUnauthorized) Error() string { - return fmt.Sprintf("[POST /infrastructure-accounts][%d] createInfrastructureAccountUnauthorized", 401) -} - -func (o *CreateInfrastructureAccountUnauthorized) String() string { - return fmt.Sprintf("[POST /infrastructure-accounts][%d] createInfrastructureAccountUnauthorized", 401) -} - -func (o *CreateInfrastructureAccountUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewCreateInfrastructureAccountForbidden creates a CreateInfrastructureAccountForbidden with default headers values -func NewCreateInfrastructureAccountForbidden() *CreateInfrastructureAccountForbidden { - return &CreateInfrastructureAccountForbidden{} -} - -/* -CreateInfrastructureAccountForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type CreateInfrastructureAccountForbidden struct { -} - -// IsSuccess returns true when this create infrastructure account forbidden response has a 2xx status code -func (o *CreateInfrastructureAccountForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create infrastructure account forbidden response has a 3xx status code -func (o *CreateInfrastructureAccountForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create infrastructure account forbidden response has a 4xx status code -func (o *CreateInfrastructureAccountForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this create infrastructure account forbidden response has a 5xx status code -func (o *CreateInfrastructureAccountForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this create infrastructure account forbidden response a status code equal to that given -func (o *CreateInfrastructureAccountForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the create infrastructure account forbidden response -func (o *CreateInfrastructureAccountForbidden) Code() int { - return 403 -} - -func (o *CreateInfrastructureAccountForbidden) Error() string { - return fmt.Sprintf("[POST /infrastructure-accounts][%d] createInfrastructureAccountForbidden", 403) -} - -func (o *CreateInfrastructureAccountForbidden) String() string { - return fmt.Sprintf("[POST /infrastructure-accounts][%d] createInfrastructureAccountForbidden", 403) -} - -func (o *CreateInfrastructureAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewCreateInfrastructureAccountConflict creates a CreateInfrastructureAccountConflict with default headers values -func NewCreateInfrastructureAccountConflict() *CreateInfrastructureAccountConflict { - return &CreateInfrastructureAccountConflict{} -} - -/* -CreateInfrastructureAccountConflict describes a response with status code 409, with default header values. - -Conflict, already existing. -*/ -type CreateInfrastructureAccountConflict struct { -} - -// IsSuccess returns true when this create infrastructure account conflict response has a 2xx status code -func (o *CreateInfrastructureAccountConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create infrastructure account conflict response has a 3xx status code -func (o *CreateInfrastructureAccountConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create infrastructure account conflict response has a 4xx status code -func (o *CreateInfrastructureAccountConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this create infrastructure account conflict response has a 5xx status code -func (o *CreateInfrastructureAccountConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this create infrastructure account conflict response a status code equal to that given -func (o *CreateInfrastructureAccountConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the create infrastructure account conflict response -func (o *CreateInfrastructureAccountConflict) Code() int { - return 409 -} - -func (o *CreateInfrastructureAccountConflict) Error() string { - return fmt.Sprintf("[POST /infrastructure-accounts][%d] createInfrastructureAccountConflict", 409) -} - -func (o *CreateInfrastructureAccountConflict) String() string { - return fmt.Sprintf("[POST /infrastructure-accounts][%d] createInfrastructureAccountConflict", 409) -} - -func (o *CreateInfrastructureAccountConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewCreateInfrastructureAccountInternalServerError creates a CreateInfrastructureAccountInternalServerError with default headers values -func NewCreateInfrastructureAccountInternalServerError() *CreateInfrastructureAccountInternalServerError { - return &CreateInfrastructureAccountInternalServerError{} -} - -/* -CreateInfrastructureAccountInternalServerError describes a response with status code 500, with default header values. - -Unexpected error -*/ -type CreateInfrastructureAccountInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this create infrastructure account internal server error response has a 2xx status code -func (o *CreateInfrastructureAccountInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create infrastructure account internal server error response has a 3xx status code -func (o *CreateInfrastructureAccountInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create infrastructure account internal server error response has a 4xx status code -func (o *CreateInfrastructureAccountInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this create infrastructure account internal server error response has a 5xx status code -func (o *CreateInfrastructureAccountInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this create infrastructure account internal server error response a status code equal to that given -func (o *CreateInfrastructureAccountInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the create infrastructure account internal server error response -func (o *CreateInfrastructureAccountInternalServerError) Code() int { - return 500 -} - -func (o *CreateInfrastructureAccountInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /infrastructure-accounts][%d] createInfrastructureAccountInternalServerError %s", 500, payload) -} - -func (o *CreateInfrastructureAccountInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[POST /infrastructure-accounts][%d] createInfrastructureAccountInternalServerError %s", 500, payload) -} - -func (o *CreateInfrastructureAccountInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateInfrastructureAccountInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/cluster-registry/client/infrastructure_accounts/get_infrastructure_account_parameters.go b/pkg/cluster-registry/client/infrastructure_accounts/get_infrastructure_account_parameters.go deleted file mode 100644 index 14c8d0ad..00000000 --- a/pkg/cluster-registry/client/infrastructure_accounts/get_infrastructure_account_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package infrastructure_accounts - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetInfrastructureAccountParams creates a new GetInfrastructureAccountParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetInfrastructureAccountParams() *GetInfrastructureAccountParams { - return &GetInfrastructureAccountParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetInfrastructureAccountParamsWithTimeout creates a new GetInfrastructureAccountParams object -// with the ability to set a timeout on a request. -func NewGetInfrastructureAccountParamsWithTimeout(timeout time.Duration) *GetInfrastructureAccountParams { - return &GetInfrastructureAccountParams{ - timeout: timeout, - } -} - -// NewGetInfrastructureAccountParamsWithContext creates a new GetInfrastructureAccountParams object -// with the ability to set a context for a request. -func NewGetInfrastructureAccountParamsWithContext(ctx context.Context) *GetInfrastructureAccountParams { - return &GetInfrastructureAccountParams{ - Context: ctx, - } -} - -// NewGetInfrastructureAccountParamsWithHTTPClient creates a new GetInfrastructureAccountParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetInfrastructureAccountParamsWithHTTPClient(client *http.Client) *GetInfrastructureAccountParams { - return &GetInfrastructureAccountParams{ - HTTPClient: client, - } -} - -/* -GetInfrastructureAccountParams contains all the parameters to send to the API endpoint - - for the get infrastructure account operation. - - Typically these are written to a http.Request. -*/ -type GetInfrastructureAccountParams struct { - - /* AccountID. - - ID of the infrastructure account. - */ - AccountID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get infrastructure account params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetInfrastructureAccountParams) WithDefaults() *GetInfrastructureAccountParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get infrastructure account params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetInfrastructureAccountParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get infrastructure account params -func (o *GetInfrastructureAccountParams) WithTimeout(timeout time.Duration) *GetInfrastructureAccountParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get infrastructure account params -func (o *GetInfrastructureAccountParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get infrastructure account params -func (o *GetInfrastructureAccountParams) WithContext(ctx context.Context) *GetInfrastructureAccountParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get infrastructure account params -func (o *GetInfrastructureAccountParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get infrastructure account params -func (o *GetInfrastructureAccountParams) WithHTTPClient(client *http.Client) *GetInfrastructureAccountParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get infrastructure account params -func (o *GetInfrastructureAccountParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithAccountID adds the accountID to the get infrastructure account params -func (o *GetInfrastructureAccountParams) WithAccountID(accountID string) *GetInfrastructureAccountParams { - o.SetAccountID(accountID) - return o -} - -// SetAccountID adds the accountId to the get infrastructure account params -func (o *GetInfrastructureAccountParams) SetAccountID(accountID string) { - o.AccountID = accountID -} - -// WriteToRequest writes these params to a swagger request -func (o *GetInfrastructureAccountParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param account_id - if err := r.SetPathParam("account_id", o.AccountID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/cluster-registry/client/infrastructure_accounts/get_infrastructure_account_responses.go b/pkg/cluster-registry/client/infrastructure_accounts/get_infrastructure_account_responses.go deleted file mode 100644 index e53a341f..00000000 --- a/pkg/cluster-registry/client/infrastructure_accounts/get_infrastructure_account_responses.go +++ /dev/null @@ -1,368 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package infrastructure_accounts - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/models" -) - -// GetInfrastructureAccountReader is a Reader for the GetInfrastructureAccount structure. -type GetInfrastructureAccountReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetInfrastructureAccountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetInfrastructureAccountOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetInfrastructureAccountUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetInfrastructureAccountForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewGetInfrastructureAccountNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetInfrastructureAccountInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /infrastructure-accounts/{account_id}] getInfrastructureAccount", response, response.Code()) - } -} - -// NewGetInfrastructureAccountOK creates a GetInfrastructureAccountOK with default headers values -func NewGetInfrastructureAccountOK() *GetInfrastructureAccountOK { - return &GetInfrastructureAccountOK{} -} - -/* -GetInfrastructureAccountOK describes a response with status code 200, with default header values. - -Infrastructure account information. -*/ -type GetInfrastructureAccountOK struct { - Payload *models.InfrastructureAccount -} - -// IsSuccess returns true when this get infrastructure account o k response has a 2xx status code -func (o *GetInfrastructureAccountOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this get infrastructure account o k response has a 3xx status code -func (o *GetInfrastructureAccountOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get infrastructure account o k response has a 4xx status code -func (o *GetInfrastructureAccountOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this get infrastructure account o k response has a 5xx status code -func (o *GetInfrastructureAccountOK) IsServerError() bool { - return false -} - -// IsCode returns true when this get infrastructure account o k response a status code equal to that given -func (o *GetInfrastructureAccountOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the get infrastructure account o k response -func (o *GetInfrastructureAccountOK) Code() int { - return 200 -} - -func (o *GetInfrastructureAccountOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /infrastructure-accounts/{account_id}][%d] getInfrastructureAccountOK %s", 200, payload) -} - -func (o *GetInfrastructureAccountOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /infrastructure-accounts/{account_id}][%d] getInfrastructureAccountOK %s", 200, payload) -} - -func (o *GetInfrastructureAccountOK) GetPayload() *models.InfrastructureAccount { - return o.Payload -} - -func (o *GetInfrastructureAccountOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.InfrastructureAccount) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetInfrastructureAccountUnauthorized creates a GetInfrastructureAccountUnauthorized with default headers values -func NewGetInfrastructureAccountUnauthorized() *GetInfrastructureAccountUnauthorized { - return &GetInfrastructureAccountUnauthorized{} -} - -/* -GetInfrastructureAccountUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type GetInfrastructureAccountUnauthorized struct { -} - -// IsSuccess returns true when this get infrastructure account unauthorized response has a 2xx status code -func (o *GetInfrastructureAccountUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this get infrastructure account unauthorized response has a 3xx status code -func (o *GetInfrastructureAccountUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get infrastructure account unauthorized response has a 4xx status code -func (o *GetInfrastructureAccountUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this get infrastructure account unauthorized response has a 5xx status code -func (o *GetInfrastructureAccountUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this get infrastructure account unauthorized response a status code equal to that given -func (o *GetInfrastructureAccountUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the get infrastructure account unauthorized response -func (o *GetInfrastructureAccountUnauthorized) Code() int { - return 401 -} - -func (o *GetInfrastructureAccountUnauthorized) Error() string { - return fmt.Sprintf("[GET /infrastructure-accounts/{account_id}][%d] getInfrastructureAccountUnauthorized", 401) -} - -func (o *GetInfrastructureAccountUnauthorized) String() string { - return fmt.Sprintf("[GET /infrastructure-accounts/{account_id}][%d] getInfrastructureAccountUnauthorized", 401) -} - -func (o *GetInfrastructureAccountUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewGetInfrastructureAccountForbidden creates a GetInfrastructureAccountForbidden with default headers values -func NewGetInfrastructureAccountForbidden() *GetInfrastructureAccountForbidden { - return &GetInfrastructureAccountForbidden{} -} - -/* -GetInfrastructureAccountForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type GetInfrastructureAccountForbidden struct { -} - -// IsSuccess returns true when this get infrastructure account forbidden response has a 2xx status code -func (o *GetInfrastructureAccountForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this get infrastructure account forbidden response has a 3xx status code -func (o *GetInfrastructureAccountForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get infrastructure account forbidden response has a 4xx status code -func (o *GetInfrastructureAccountForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this get infrastructure account forbidden response has a 5xx status code -func (o *GetInfrastructureAccountForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this get infrastructure account forbidden response a status code equal to that given -func (o *GetInfrastructureAccountForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the get infrastructure account forbidden response -func (o *GetInfrastructureAccountForbidden) Code() int { - return 403 -} - -func (o *GetInfrastructureAccountForbidden) Error() string { - return fmt.Sprintf("[GET /infrastructure-accounts/{account_id}][%d] getInfrastructureAccountForbidden", 403) -} - -func (o *GetInfrastructureAccountForbidden) String() string { - return fmt.Sprintf("[GET /infrastructure-accounts/{account_id}][%d] getInfrastructureAccountForbidden", 403) -} - -func (o *GetInfrastructureAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewGetInfrastructureAccountNotFound creates a GetInfrastructureAccountNotFound with default headers values -func NewGetInfrastructureAccountNotFound() *GetInfrastructureAccountNotFound { - return &GetInfrastructureAccountNotFound{} -} - -/* -GetInfrastructureAccountNotFound describes a response with status code 404, with default header values. - -InfrastructureAccount not found -*/ -type GetInfrastructureAccountNotFound struct { -} - -// IsSuccess returns true when this get infrastructure account not found response has a 2xx status code -func (o *GetInfrastructureAccountNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this get infrastructure account not found response has a 3xx status code -func (o *GetInfrastructureAccountNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get infrastructure account not found response has a 4xx status code -func (o *GetInfrastructureAccountNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this get infrastructure account not found response has a 5xx status code -func (o *GetInfrastructureAccountNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this get infrastructure account not found response a status code equal to that given -func (o *GetInfrastructureAccountNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the get infrastructure account not found response -func (o *GetInfrastructureAccountNotFound) Code() int { - return 404 -} - -func (o *GetInfrastructureAccountNotFound) Error() string { - return fmt.Sprintf("[GET /infrastructure-accounts/{account_id}][%d] getInfrastructureAccountNotFound", 404) -} - -func (o *GetInfrastructureAccountNotFound) String() string { - return fmt.Sprintf("[GET /infrastructure-accounts/{account_id}][%d] getInfrastructureAccountNotFound", 404) -} - -func (o *GetInfrastructureAccountNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewGetInfrastructureAccountInternalServerError creates a GetInfrastructureAccountInternalServerError with default headers values -func NewGetInfrastructureAccountInternalServerError() *GetInfrastructureAccountInternalServerError { - return &GetInfrastructureAccountInternalServerError{} -} - -/* -GetInfrastructureAccountInternalServerError describes a response with status code 500, with default header values. - -Unexpected error -*/ -type GetInfrastructureAccountInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this get infrastructure account internal server error response has a 2xx status code -func (o *GetInfrastructureAccountInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this get infrastructure account internal server error response has a 3xx status code -func (o *GetInfrastructureAccountInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get infrastructure account internal server error response has a 4xx status code -func (o *GetInfrastructureAccountInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this get infrastructure account internal server error response has a 5xx status code -func (o *GetInfrastructureAccountInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this get infrastructure account internal server error response a status code equal to that given -func (o *GetInfrastructureAccountInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the get infrastructure account internal server error response -func (o *GetInfrastructureAccountInternalServerError) Code() int { - return 500 -} - -func (o *GetInfrastructureAccountInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /infrastructure-accounts/{account_id}][%d] getInfrastructureAccountInternalServerError %s", 500, payload) -} - -func (o *GetInfrastructureAccountInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /infrastructure-accounts/{account_id}][%d] getInfrastructureAccountInternalServerError %s", 500, payload) -} - -func (o *GetInfrastructureAccountInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *GetInfrastructureAccountInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/cluster-registry/client/infrastructure_accounts/infrastructure_accounts_client.go b/pkg/cluster-registry/client/infrastructure_accounts/infrastructure_accounts_client.go deleted file mode 100644 index 51a85c7d..00000000 --- a/pkg/cluster-registry/client/infrastructure_accounts/infrastructure_accounts_client.go +++ /dev/null @@ -1,235 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package infrastructure_accounts - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new infrastructure accounts API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new infrastructure accounts API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new infrastructure accounts API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for infrastructure accounts API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreateInfrastructureAccount(params *CreateInfrastructureAccountParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateInfrastructureAccountCreated, error) - - GetInfrastructureAccount(params *GetInfrastructureAccountParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetInfrastructureAccountOK, error) - - ListInfrastructureAccounts(params *ListInfrastructureAccountsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListInfrastructureAccountsOK, error) - - UpdateInfrastructureAccount(params *UpdateInfrastructureAccountParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateInfrastructureAccountOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -CreateInfrastructureAccount creates infrastructure account - -Creates a new infrastructure account -*/ -func (a *Client) CreateInfrastructureAccount(params *CreateInfrastructureAccountParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateInfrastructureAccountCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateInfrastructureAccountParams() - } - op := &runtime.ClientOperation{ - ID: "createInfrastructureAccount", - Method: "POST", - PathPattern: "/infrastructure-accounts", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &CreateInfrastructureAccountReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateInfrastructureAccountCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createInfrastructureAccount: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -GetInfrastructureAccount gets single infrastructure account - -Read information regarding the infrastructure account. -*/ -func (a *Client) GetInfrastructureAccount(params *GetInfrastructureAccountParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetInfrastructureAccountOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetInfrastructureAccountParams() - } - op := &runtime.ClientOperation{ - ID: "getInfrastructureAccount", - Method: "GET", - PathPattern: "/infrastructure-accounts/{account_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &GetInfrastructureAccountReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetInfrastructureAccountOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getInfrastructureAccount: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -ListInfrastructureAccounts lists all registered infrastructure accounts -*/ -func (a *Client) ListInfrastructureAccounts(params *ListInfrastructureAccountsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListInfrastructureAccountsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListInfrastructureAccountsParams() - } - op := &runtime.ClientOperation{ - ID: "listInfrastructureAccounts", - Method: "GET", - PathPattern: "/infrastructure-accounts", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListInfrastructureAccountsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListInfrastructureAccountsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listInfrastructureAccounts: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -UpdateInfrastructureAccount updates infrastructure account - -update an infrastructure account. -*/ -func (a *Client) UpdateInfrastructureAccount(params *UpdateInfrastructureAccountParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateInfrastructureAccountOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateInfrastructureAccountParams() - } - op := &runtime.ClientOperation{ - ID: "updateInfrastructureAccount", - Method: "PATCH", - PathPattern: "/infrastructure-accounts/{account_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &UpdateInfrastructureAccountReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateInfrastructureAccountOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateInfrastructureAccount: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/pkg/cluster-registry/client/infrastructure_accounts/list_infrastructure_accounts_parameters.go b/pkg/cluster-registry/client/infrastructure_accounts/list_infrastructure_accounts_parameters.go deleted file mode 100644 index 985bb689..00000000 --- a/pkg/cluster-registry/client/infrastructure_accounts/list_infrastructure_accounts_parameters.go +++ /dev/null @@ -1,404 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package infrastructure_accounts - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListInfrastructureAccountsParams creates a new ListInfrastructureAccountsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListInfrastructureAccountsParams() *ListInfrastructureAccountsParams { - return &ListInfrastructureAccountsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListInfrastructureAccountsParamsWithTimeout creates a new ListInfrastructureAccountsParams object -// with the ability to set a timeout on a request. -func NewListInfrastructureAccountsParamsWithTimeout(timeout time.Duration) *ListInfrastructureAccountsParams { - return &ListInfrastructureAccountsParams{ - timeout: timeout, - } -} - -// NewListInfrastructureAccountsParamsWithContext creates a new ListInfrastructureAccountsParams object -// with the ability to set a context for a request. -func NewListInfrastructureAccountsParamsWithContext(ctx context.Context) *ListInfrastructureAccountsParams { - return &ListInfrastructureAccountsParams{ - Context: ctx, - } -} - -// NewListInfrastructureAccountsParamsWithHTTPClient creates a new ListInfrastructureAccountsParams object -// with the ability to set a custom HTTPClient for a request. -func NewListInfrastructureAccountsParamsWithHTTPClient(client *http.Client) *ListInfrastructureAccountsParams { - return &ListInfrastructureAccountsParams{ - HTTPClient: client, - } -} - -/* -ListInfrastructureAccountsParams contains all the parameters to send to the API endpoint - - for the list infrastructure accounts operation. - - Typically these are written to a http.Request. -*/ -type ListInfrastructureAccountsParams struct { - - /* CostCenter. - - Filter on cost center number. - */ - CostCenter *string - - /* CriticalityLevel. - - Filter on criticality level. - - Format: int32 - */ - CriticalityLevel *int32 - - /* Environment. - - Filter on environment. - */ - Environment *string - - /* ExternalID. - - Filter on external id. - */ - ExternalID *string - - /* LifecycleStatus. - - Filter on cluster lifecycle status. - */ - LifecycleStatus *string - - /* Name. - - Filter on name. - */ - Name *string - - /* Owner. - - Filter on owner. - */ - Owner *string - - /* Type. - - Filter on type. - */ - Type *string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list infrastructure accounts params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListInfrastructureAccountsParams) WithDefaults() *ListInfrastructureAccountsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list infrastructure accounts params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListInfrastructureAccountsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list infrastructure accounts params -func (o *ListInfrastructureAccountsParams) WithTimeout(timeout time.Duration) *ListInfrastructureAccountsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list infrastructure accounts params -func (o *ListInfrastructureAccountsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list infrastructure accounts params -func (o *ListInfrastructureAccountsParams) WithContext(ctx context.Context) *ListInfrastructureAccountsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list infrastructure accounts params -func (o *ListInfrastructureAccountsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list infrastructure accounts params -func (o *ListInfrastructureAccountsParams) WithHTTPClient(client *http.Client) *ListInfrastructureAccountsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list infrastructure accounts params -func (o *ListInfrastructureAccountsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCostCenter adds the costCenter to the list infrastructure accounts params -func (o *ListInfrastructureAccountsParams) WithCostCenter(costCenter *string) *ListInfrastructureAccountsParams { - o.SetCostCenter(costCenter) - return o -} - -// SetCostCenter adds the costCenter to the list infrastructure accounts params -func (o *ListInfrastructureAccountsParams) SetCostCenter(costCenter *string) { - o.CostCenter = costCenter -} - -// WithCriticalityLevel adds the criticalityLevel to the list infrastructure accounts params -func (o *ListInfrastructureAccountsParams) WithCriticalityLevel(criticalityLevel *int32) *ListInfrastructureAccountsParams { - o.SetCriticalityLevel(criticalityLevel) - return o -} - -// SetCriticalityLevel adds the criticalityLevel to the list infrastructure accounts params -func (o *ListInfrastructureAccountsParams) SetCriticalityLevel(criticalityLevel *int32) { - o.CriticalityLevel = criticalityLevel -} - -// WithEnvironment adds the environment to the list infrastructure accounts params -func (o *ListInfrastructureAccountsParams) WithEnvironment(environment *string) *ListInfrastructureAccountsParams { - o.SetEnvironment(environment) - return o -} - -// SetEnvironment adds the environment to the list infrastructure accounts params -func (o *ListInfrastructureAccountsParams) SetEnvironment(environment *string) { - o.Environment = environment -} - -// WithExternalID adds the externalID to the list infrastructure accounts params -func (o *ListInfrastructureAccountsParams) WithExternalID(externalID *string) *ListInfrastructureAccountsParams { - o.SetExternalID(externalID) - return o -} - -// SetExternalID adds the externalId to the list infrastructure accounts params -func (o *ListInfrastructureAccountsParams) SetExternalID(externalID *string) { - o.ExternalID = externalID -} - -// WithLifecycleStatus adds the lifecycleStatus to the list infrastructure accounts params -func (o *ListInfrastructureAccountsParams) WithLifecycleStatus(lifecycleStatus *string) *ListInfrastructureAccountsParams { - o.SetLifecycleStatus(lifecycleStatus) - return o -} - -// SetLifecycleStatus adds the lifecycleStatus to the list infrastructure accounts params -func (o *ListInfrastructureAccountsParams) SetLifecycleStatus(lifecycleStatus *string) { - o.LifecycleStatus = lifecycleStatus -} - -// WithName adds the name to the list infrastructure accounts params -func (o *ListInfrastructureAccountsParams) WithName(name *string) *ListInfrastructureAccountsParams { - o.SetName(name) - return o -} - -// SetName adds the name to the list infrastructure accounts params -func (o *ListInfrastructureAccountsParams) SetName(name *string) { - o.Name = name -} - -// WithOwner adds the owner to the list infrastructure accounts params -func (o *ListInfrastructureAccountsParams) WithOwner(owner *string) *ListInfrastructureAccountsParams { - o.SetOwner(owner) - return o -} - -// SetOwner adds the owner to the list infrastructure accounts params -func (o *ListInfrastructureAccountsParams) SetOwner(owner *string) { - o.Owner = owner -} - -// WithType adds the typeVar to the list infrastructure accounts params -func (o *ListInfrastructureAccountsParams) WithType(typeVar *string) *ListInfrastructureAccountsParams { - o.SetType(typeVar) - return o -} - -// SetType adds the type to the list infrastructure accounts params -func (o *ListInfrastructureAccountsParams) SetType(typeVar *string) { - o.Type = typeVar -} - -// WriteToRequest writes these params to a swagger request -func (o *ListInfrastructureAccountsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.CostCenter != nil { - - // query param cost_center - var qrCostCenter string - - if o.CostCenter != nil { - qrCostCenter = *o.CostCenter - } - qCostCenter := qrCostCenter - if qCostCenter != "" { - - if err := r.SetQueryParam("cost_center", qCostCenter); err != nil { - return err - } - } - } - - if o.CriticalityLevel != nil { - - // query param criticality_level - var qrCriticalityLevel int32 - - if o.CriticalityLevel != nil { - qrCriticalityLevel = *o.CriticalityLevel - } - qCriticalityLevel := swag.FormatInt32(qrCriticalityLevel) - if qCriticalityLevel != "" { - - if err := r.SetQueryParam("criticality_level", qCriticalityLevel); err != nil { - return err - } - } - } - - if o.Environment != nil { - - // query param environment - var qrEnvironment string - - if o.Environment != nil { - qrEnvironment = *o.Environment - } - qEnvironment := qrEnvironment - if qEnvironment != "" { - - if err := r.SetQueryParam("environment", qEnvironment); err != nil { - return err - } - } - } - - if o.ExternalID != nil { - - // query param external_id - var qrExternalID string - - if o.ExternalID != nil { - qrExternalID = *o.ExternalID - } - qExternalID := qrExternalID - if qExternalID != "" { - - if err := r.SetQueryParam("external_id", qExternalID); err != nil { - return err - } - } - } - - if o.LifecycleStatus != nil { - - // query param lifecycle_status - var qrLifecycleStatus string - - if o.LifecycleStatus != nil { - qrLifecycleStatus = *o.LifecycleStatus - } - qLifecycleStatus := qrLifecycleStatus - if qLifecycleStatus != "" { - - if err := r.SetQueryParam("lifecycle_status", qLifecycleStatus); err != nil { - return err - } - } - } - - if o.Name != nil { - - // query param name - var qrName string - - if o.Name != nil { - qrName = *o.Name - } - qName := qrName - if qName != "" { - - if err := r.SetQueryParam("name", qName); err != nil { - return err - } - } - } - - if o.Owner != nil { - - // query param owner - var qrOwner string - - if o.Owner != nil { - qrOwner = *o.Owner - } - qOwner := qrOwner - if qOwner != "" { - - if err := r.SetQueryParam("owner", qOwner); err != nil { - return err - } - } - } - - if o.Type != nil { - - // query param type - var qrType string - - if o.Type != nil { - qrType = *o.Type - } - qType := qrType - if qType != "" { - - if err := r.SetQueryParam("type", qType); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/cluster-registry/client/infrastructure_accounts/list_infrastructure_accounts_responses.go b/pkg/cluster-registry/client/infrastructure_accounts/list_infrastructure_accounts_responses.go deleted file mode 100644 index 3a3c5f44..00000000 --- a/pkg/cluster-registry/client/infrastructure_accounts/list_infrastructure_accounts_responses.go +++ /dev/null @@ -1,417 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package infrastructure_accounts - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - "fmt" - "io" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/models" -) - -// ListInfrastructureAccountsReader is a Reader for the ListInfrastructureAccounts structure. -type ListInfrastructureAccountsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListInfrastructureAccountsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListInfrastructureAccountsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewListInfrastructureAccountsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewListInfrastructureAccountsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewListInfrastructureAccountsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /infrastructure-accounts] listInfrastructureAccounts", response, response.Code()) - } -} - -// NewListInfrastructureAccountsOK creates a ListInfrastructureAccountsOK with default headers values -func NewListInfrastructureAccountsOK() *ListInfrastructureAccountsOK { - return &ListInfrastructureAccountsOK{} -} - -/* -ListInfrastructureAccountsOK describes a response with status code 200, with default header values. - -List of all infrastructure accounts. -*/ -type ListInfrastructureAccountsOK struct { - Payload *ListInfrastructureAccountsOKBody -} - -// IsSuccess returns true when this list infrastructure accounts o k response has a 2xx status code -func (o *ListInfrastructureAccountsOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this list infrastructure accounts o k response has a 3xx status code -func (o *ListInfrastructureAccountsOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list infrastructure accounts o k response has a 4xx status code -func (o *ListInfrastructureAccountsOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this list infrastructure accounts o k response has a 5xx status code -func (o *ListInfrastructureAccountsOK) IsServerError() bool { - return false -} - -// IsCode returns true when this list infrastructure accounts o k response a status code equal to that given -func (o *ListInfrastructureAccountsOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the list infrastructure accounts o k response -func (o *ListInfrastructureAccountsOK) Code() int { - return 200 -} - -func (o *ListInfrastructureAccountsOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /infrastructure-accounts][%d] listInfrastructureAccountsOK %s", 200, payload) -} - -func (o *ListInfrastructureAccountsOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /infrastructure-accounts][%d] listInfrastructureAccountsOK %s", 200, payload) -} - -func (o *ListInfrastructureAccountsOK) GetPayload() *ListInfrastructureAccountsOKBody { - return o.Payload -} - -func (o *ListInfrastructureAccountsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(ListInfrastructureAccountsOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListInfrastructureAccountsUnauthorized creates a ListInfrastructureAccountsUnauthorized with default headers values -func NewListInfrastructureAccountsUnauthorized() *ListInfrastructureAccountsUnauthorized { - return &ListInfrastructureAccountsUnauthorized{} -} - -/* -ListInfrastructureAccountsUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type ListInfrastructureAccountsUnauthorized struct { -} - -// IsSuccess returns true when this list infrastructure accounts unauthorized response has a 2xx status code -func (o *ListInfrastructureAccountsUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this list infrastructure accounts unauthorized response has a 3xx status code -func (o *ListInfrastructureAccountsUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list infrastructure accounts unauthorized response has a 4xx status code -func (o *ListInfrastructureAccountsUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this list infrastructure accounts unauthorized response has a 5xx status code -func (o *ListInfrastructureAccountsUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this list infrastructure accounts unauthorized response a status code equal to that given -func (o *ListInfrastructureAccountsUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the list infrastructure accounts unauthorized response -func (o *ListInfrastructureAccountsUnauthorized) Code() int { - return 401 -} - -func (o *ListInfrastructureAccountsUnauthorized) Error() string { - return fmt.Sprintf("[GET /infrastructure-accounts][%d] listInfrastructureAccountsUnauthorized", 401) -} - -func (o *ListInfrastructureAccountsUnauthorized) String() string { - return fmt.Sprintf("[GET /infrastructure-accounts][%d] listInfrastructureAccountsUnauthorized", 401) -} - -func (o *ListInfrastructureAccountsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewListInfrastructureAccountsForbidden creates a ListInfrastructureAccountsForbidden with default headers values -func NewListInfrastructureAccountsForbidden() *ListInfrastructureAccountsForbidden { - return &ListInfrastructureAccountsForbidden{} -} - -/* -ListInfrastructureAccountsForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ListInfrastructureAccountsForbidden struct { -} - -// IsSuccess returns true when this list infrastructure accounts forbidden response has a 2xx status code -func (o *ListInfrastructureAccountsForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this list infrastructure accounts forbidden response has a 3xx status code -func (o *ListInfrastructureAccountsForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list infrastructure accounts forbidden response has a 4xx status code -func (o *ListInfrastructureAccountsForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this list infrastructure accounts forbidden response has a 5xx status code -func (o *ListInfrastructureAccountsForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this list infrastructure accounts forbidden response a status code equal to that given -func (o *ListInfrastructureAccountsForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the list infrastructure accounts forbidden response -func (o *ListInfrastructureAccountsForbidden) Code() int { - return 403 -} - -func (o *ListInfrastructureAccountsForbidden) Error() string { - return fmt.Sprintf("[GET /infrastructure-accounts][%d] listInfrastructureAccountsForbidden", 403) -} - -func (o *ListInfrastructureAccountsForbidden) String() string { - return fmt.Sprintf("[GET /infrastructure-accounts][%d] listInfrastructureAccountsForbidden", 403) -} - -func (o *ListInfrastructureAccountsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewListInfrastructureAccountsInternalServerError creates a ListInfrastructureAccountsInternalServerError with default headers values -func NewListInfrastructureAccountsInternalServerError() *ListInfrastructureAccountsInternalServerError { - return &ListInfrastructureAccountsInternalServerError{} -} - -/* -ListInfrastructureAccountsInternalServerError describes a response with status code 500, with default header values. - -Unexpected error -*/ -type ListInfrastructureAccountsInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this list infrastructure accounts internal server error response has a 2xx status code -func (o *ListInfrastructureAccountsInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this list infrastructure accounts internal server error response has a 3xx status code -func (o *ListInfrastructureAccountsInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list infrastructure accounts internal server error response has a 4xx status code -func (o *ListInfrastructureAccountsInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this list infrastructure accounts internal server error response has a 5xx status code -func (o *ListInfrastructureAccountsInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this list infrastructure accounts internal server error response a status code equal to that given -func (o *ListInfrastructureAccountsInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the list infrastructure accounts internal server error response -func (o *ListInfrastructureAccountsInternalServerError) Code() int { - return 500 -} - -func (o *ListInfrastructureAccountsInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /infrastructure-accounts][%d] listInfrastructureAccountsInternalServerError %s", 500, payload) -} - -func (o *ListInfrastructureAccountsInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /infrastructure-accounts][%d] listInfrastructureAccountsInternalServerError %s", 500, payload) -} - -func (o *ListInfrastructureAccountsInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *ListInfrastructureAccountsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -ListInfrastructureAccountsOKBody list infrastructure accounts o k body -swagger:model ListInfrastructureAccountsOKBody -*/ -type ListInfrastructureAccountsOKBody struct { - - // items - Items []*models.InfrastructureAccount `json:"items"` -} - -// Validate validates this list infrastructure accounts o k body -func (o *ListInfrastructureAccountsOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateItems(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListInfrastructureAccountsOKBody) validateItems(formats strfmt.Registry) error { - if swag.IsZero(o.Items) { // not required - return nil - } - - for i := 0; i < len(o.Items); i++ { - if swag.IsZero(o.Items[i]) { // not required - continue - } - - if o.Items[i] != nil { - if err := o.Items[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("listInfrastructureAccountsOK" + "." + "items" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("listInfrastructureAccountsOK" + "." + "items" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list infrastructure accounts o k body based on the context it is used -func (o *ListInfrastructureAccountsOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateItems(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListInfrastructureAccountsOKBody) contextValidateItems(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(o.Items); i++ { - - if o.Items[i] != nil { - - if swag.IsZero(o.Items[i]) { // not required - return nil - } - - if err := o.Items[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("listInfrastructureAccountsOK" + "." + "items" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("listInfrastructureAccountsOK" + "." + "items" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListInfrastructureAccountsOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListInfrastructureAccountsOKBody) UnmarshalBinary(b []byte) error { - var res ListInfrastructureAccountsOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/pkg/cluster-registry/client/infrastructure_accounts/update_infrastructure_account_parameters.go b/pkg/cluster-registry/client/infrastructure_accounts/update_infrastructure_account_parameters.go deleted file mode 100644 index ce0302f0..00000000 --- a/pkg/cluster-registry/client/infrastructure_accounts/update_infrastructure_account_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package infrastructure_accounts - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/models" -) - -// NewUpdateInfrastructureAccountParams creates a new UpdateInfrastructureAccountParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateInfrastructureAccountParams() *UpdateInfrastructureAccountParams { - return &UpdateInfrastructureAccountParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateInfrastructureAccountParamsWithTimeout creates a new UpdateInfrastructureAccountParams object -// with the ability to set a timeout on a request. -func NewUpdateInfrastructureAccountParamsWithTimeout(timeout time.Duration) *UpdateInfrastructureAccountParams { - return &UpdateInfrastructureAccountParams{ - timeout: timeout, - } -} - -// NewUpdateInfrastructureAccountParamsWithContext creates a new UpdateInfrastructureAccountParams object -// with the ability to set a context for a request. -func NewUpdateInfrastructureAccountParamsWithContext(ctx context.Context) *UpdateInfrastructureAccountParams { - return &UpdateInfrastructureAccountParams{ - Context: ctx, - } -} - -// NewUpdateInfrastructureAccountParamsWithHTTPClient creates a new UpdateInfrastructureAccountParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateInfrastructureAccountParamsWithHTTPClient(client *http.Client) *UpdateInfrastructureAccountParams { - return &UpdateInfrastructureAccountParams{ - HTTPClient: client, - } -} - -/* -UpdateInfrastructureAccountParams contains all the parameters to send to the API endpoint - - for the update infrastructure account operation. - - Typically these are written to a http.Request. -*/ -type UpdateInfrastructureAccountParams struct { - - /* AccountID. - - ID of the infrastructure account. - */ - AccountID string - - /* InfrastructureAccount. - - Infrastructure Account that will be updated. - */ - InfrastructureAccount *models.InfrastructureAccountUpdate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update infrastructure account params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateInfrastructureAccountParams) WithDefaults() *UpdateInfrastructureAccountParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update infrastructure account params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateInfrastructureAccountParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update infrastructure account params -func (o *UpdateInfrastructureAccountParams) WithTimeout(timeout time.Duration) *UpdateInfrastructureAccountParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update infrastructure account params -func (o *UpdateInfrastructureAccountParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update infrastructure account params -func (o *UpdateInfrastructureAccountParams) WithContext(ctx context.Context) *UpdateInfrastructureAccountParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update infrastructure account params -func (o *UpdateInfrastructureAccountParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update infrastructure account params -func (o *UpdateInfrastructureAccountParams) WithHTTPClient(client *http.Client) *UpdateInfrastructureAccountParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update infrastructure account params -func (o *UpdateInfrastructureAccountParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithAccountID adds the accountID to the update infrastructure account params -func (o *UpdateInfrastructureAccountParams) WithAccountID(accountID string) *UpdateInfrastructureAccountParams { - o.SetAccountID(accountID) - return o -} - -// SetAccountID adds the accountId to the update infrastructure account params -func (o *UpdateInfrastructureAccountParams) SetAccountID(accountID string) { - o.AccountID = accountID -} - -// WithInfrastructureAccount adds the infrastructureAccount to the update infrastructure account params -func (o *UpdateInfrastructureAccountParams) WithInfrastructureAccount(infrastructureAccount *models.InfrastructureAccountUpdate) *UpdateInfrastructureAccountParams { - o.SetInfrastructureAccount(infrastructureAccount) - return o -} - -// SetInfrastructureAccount adds the infrastructureAccount to the update infrastructure account params -func (o *UpdateInfrastructureAccountParams) SetInfrastructureAccount(infrastructureAccount *models.InfrastructureAccountUpdate) { - o.InfrastructureAccount = infrastructureAccount -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateInfrastructureAccountParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param account_id - if err := r.SetPathParam("account_id", o.AccountID); err != nil { - return err - } - if o.InfrastructureAccount != nil { - if err := r.SetBodyParam(o.InfrastructureAccount); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/cluster-registry/client/infrastructure_accounts/update_infrastructure_account_responses.go b/pkg/cluster-registry/client/infrastructure_accounts/update_infrastructure_account_responses.go deleted file mode 100644 index 59845102..00000000 --- a/pkg/cluster-registry/client/infrastructure_accounts/update_infrastructure_account_responses.go +++ /dev/null @@ -1,368 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package infrastructure_accounts - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/models" -) - -// UpdateInfrastructureAccountReader is a Reader for the UpdateInfrastructureAccount structure. -type UpdateInfrastructureAccountReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateInfrastructureAccountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateInfrastructureAccountOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewUpdateInfrastructureAccountUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewUpdateInfrastructureAccountForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateInfrastructureAccountNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewUpdateInfrastructureAccountInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PATCH /infrastructure-accounts/{account_id}] updateInfrastructureAccount", response, response.Code()) - } -} - -// NewUpdateInfrastructureAccountOK creates a UpdateInfrastructureAccountOK with default headers values -func NewUpdateInfrastructureAccountOK() *UpdateInfrastructureAccountOK { - return &UpdateInfrastructureAccountOK{} -} - -/* -UpdateInfrastructureAccountOK describes a response with status code 200, with default header values. - -The infrastructure account update request is accepted -*/ -type UpdateInfrastructureAccountOK struct { - Payload *models.InfrastructureAccount -} - -// IsSuccess returns true when this update infrastructure account o k response has a 2xx status code -func (o *UpdateInfrastructureAccountOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this update infrastructure account o k response has a 3xx status code -func (o *UpdateInfrastructureAccountOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update infrastructure account o k response has a 4xx status code -func (o *UpdateInfrastructureAccountOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this update infrastructure account o k response has a 5xx status code -func (o *UpdateInfrastructureAccountOK) IsServerError() bool { - return false -} - -// IsCode returns true when this update infrastructure account o k response a status code equal to that given -func (o *UpdateInfrastructureAccountOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the update infrastructure account o k response -func (o *UpdateInfrastructureAccountOK) Code() int { - return 200 -} - -func (o *UpdateInfrastructureAccountOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PATCH /infrastructure-accounts/{account_id}][%d] updateInfrastructureAccountOK %s", 200, payload) -} - -func (o *UpdateInfrastructureAccountOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PATCH /infrastructure-accounts/{account_id}][%d] updateInfrastructureAccountOK %s", 200, payload) -} - -func (o *UpdateInfrastructureAccountOK) GetPayload() *models.InfrastructureAccount { - return o.Payload -} - -func (o *UpdateInfrastructureAccountOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.InfrastructureAccount) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateInfrastructureAccountUnauthorized creates a UpdateInfrastructureAccountUnauthorized with default headers values -func NewUpdateInfrastructureAccountUnauthorized() *UpdateInfrastructureAccountUnauthorized { - return &UpdateInfrastructureAccountUnauthorized{} -} - -/* -UpdateInfrastructureAccountUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type UpdateInfrastructureAccountUnauthorized struct { -} - -// IsSuccess returns true when this update infrastructure account unauthorized response has a 2xx status code -func (o *UpdateInfrastructureAccountUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update infrastructure account unauthorized response has a 3xx status code -func (o *UpdateInfrastructureAccountUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update infrastructure account unauthorized response has a 4xx status code -func (o *UpdateInfrastructureAccountUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this update infrastructure account unauthorized response has a 5xx status code -func (o *UpdateInfrastructureAccountUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this update infrastructure account unauthorized response a status code equal to that given -func (o *UpdateInfrastructureAccountUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the update infrastructure account unauthorized response -func (o *UpdateInfrastructureAccountUnauthorized) Code() int { - return 401 -} - -func (o *UpdateInfrastructureAccountUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /infrastructure-accounts/{account_id}][%d] updateInfrastructureAccountUnauthorized", 401) -} - -func (o *UpdateInfrastructureAccountUnauthorized) String() string { - return fmt.Sprintf("[PATCH /infrastructure-accounts/{account_id}][%d] updateInfrastructureAccountUnauthorized", 401) -} - -func (o *UpdateInfrastructureAccountUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewUpdateInfrastructureAccountForbidden creates a UpdateInfrastructureAccountForbidden with default headers values -func NewUpdateInfrastructureAccountForbidden() *UpdateInfrastructureAccountForbidden { - return &UpdateInfrastructureAccountForbidden{} -} - -/* -UpdateInfrastructureAccountForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type UpdateInfrastructureAccountForbidden struct { -} - -// IsSuccess returns true when this update infrastructure account forbidden response has a 2xx status code -func (o *UpdateInfrastructureAccountForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update infrastructure account forbidden response has a 3xx status code -func (o *UpdateInfrastructureAccountForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update infrastructure account forbidden response has a 4xx status code -func (o *UpdateInfrastructureAccountForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this update infrastructure account forbidden response has a 5xx status code -func (o *UpdateInfrastructureAccountForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this update infrastructure account forbidden response a status code equal to that given -func (o *UpdateInfrastructureAccountForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the update infrastructure account forbidden response -func (o *UpdateInfrastructureAccountForbidden) Code() int { - return 403 -} - -func (o *UpdateInfrastructureAccountForbidden) Error() string { - return fmt.Sprintf("[PATCH /infrastructure-accounts/{account_id}][%d] updateInfrastructureAccountForbidden", 403) -} - -func (o *UpdateInfrastructureAccountForbidden) String() string { - return fmt.Sprintf("[PATCH /infrastructure-accounts/{account_id}][%d] updateInfrastructureAccountForbidden", 403) -} - -func (o *UpdateInfrastructureAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewUpdateInfrastructureAccountNotFound creates a UpdateInfrastructureAccountNotFound with default headers values -func NewUpdateInfrastructureAccountNotFound() *UpdateInfrastructureAccountNotFound { - return &UpdateInfrastructureAccountNotFound{} -} - -/* -UpdateInfrastructureAccountNotFound describes a response with status code 404, with default header values. - -InfrastructureAccount not found -*/ -type UpdateInfrastructureAccountNotFound struct { -} - -// IsSuccess returns true when this update infrastructure account not found response has a 2xx status code -func (o *UpdateInfrastructureAccountNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update infrastructure account not found response has a 3xx status code -func (o *UpdateInfrastructureAccountNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update infrastructure account not found response has a 4xx status code -func (o *UpdateInfrastructureAccountNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this update infrastructure account not found response has a 5xx status code -func (o *UpdateInfrastructureAccountNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this update infrastructure account not found response a status code equal to that given -func (o *UpdateInfrastructureAccountNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the update infrastructure account not found response -func (o *UpdateInfrastructureAccountNotFound) Code() int { - return 404 -} - -func (o *UpdateInfrastructureAccountNotFound) Error() string { - return fmt.Sprintf("[PATCH /infrastructure-accounts/{account_id}][%d] updateInfrastructureAccountNotFound", 404) -} - -func (o *UpdateInfrastructureAccountNotFound) String() string { - return fmt.Sprintf("[PATCH /infrastructure-accounts/{account_id}][%d] updateInfrastructureAccountNotFound", 404) -} - -func (o *UpdateInfrastructureAccountNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewUpdateInfrastructureAccountInternalServerError creates a UpdateInfrastructureAccountInternalServerError with default headers values -func NewUpdateInfrastructureAccountInternalServerError() *UpdateInfrastructureAccountInternalServerError { - return &UpdateInfrastructureAccountInternalServerError{} -} - -/* -UpdateInfrastructureAccountInternalServerError describes a response with status code 500, with default header values. - -Unexpected error -*/ -type UpdateInfrastructureAccountInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this update infrastructure account internal server error response has a 2xx status code -func (o *UpdateInfrastructureAccountInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update infrastructure account internal server error response has a 3xx status code -func (o *UpdateInfrastructureAccountInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update infrastructure account internal server error response has a 4xx status code -func (o *UpdateInfrastructureAccountInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this update infrastructure account internal server error response has a 5xx status code -func (o *UpdateInfrastructureAccountInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this update infrastructure account internal server error response a status code equal to that given -func (o *UpdateInfrastructureAccountInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the update infrastructure account internal server error response -func (o *UpdateInfrastructureAccountInternalServerError) Code() int { - return 500 -} - -func (o *UpdateInfrastructureAccountInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PATCH /infrastructure-accounts/{account_id}][%d] updateInfrastructureAccountInternalServerError %s", 500, payload) -} - -func (o *UpdateInfrastructureAccountInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PATCH /infrastructure-accounts/{account_id}][%d] updateInfrastructureAccountInternalServerError %s", 500, payload) -} - -func (o *UpdateInfrastructureAccountInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateInfrastructureAccountInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/cluster-registry/client/node_pool_config_items/add_or_update_node_pool_config_item_parameters.go b/pkg/cluster-registry/client/node_pool_config_items/add_or_update_node_pool_config_item_parameters.go deleted file mode 100644 index d8b7fe3e..00000000 --- a/pkg/cluster-registry/client/node_pool_config_items/add_or_update_node_pool_config_item_parameters.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package node_pool_config_items - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/models" -) - -// NewAddOrUpdateNodePoolConfigItemParams creates a new AddOrUpdateNodePoolConfigItemParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewAddOrUpdateNodePoolConfigItemParams() *AddOrUpdateNodePoolConfigItemParams { - return &AddOrUpdateNodePoolConfigItemParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewAddOrUpdateNodePoolConfigItemParamsWithTimeout creates a new AddOrUpdateNodePoolConfigItemParams object -// with the ability to set a timeout on a request. -func NewAddOrUpdateNodePoolConfigItemParamsWithTimeout(timeout time.Duration) *AddOrUpdateNodePoolConfigItemParams { - return &AddOrUpdateNodePoolConfigItemParams{ - timeout: timeout, - } -} - -// NewAddOrUpdateNodePoolConfigItemParamsWithContext creates a new AddOrUpdateNodePoolConfigItemParams object -// with the ability to set a context for a request. -func NewAddOrUpdateNodePoolConfigItemParamsWithContext(ctx context.Context) *AddOrUpdateNodePoolConfigItemParams { - return &AddOrUpdateNodePoolConfigItemParams{ - Context: ctx, - } -} - -// NewAddOrUpdateNodePoolConfigItemParamsWithHTTPClient creates a new AddOrUpdateNodePoolConfigItemParams object -// with the ability to set a custom HTTPClient for a request. -func NewAddOrUpdateNodePoolConfigItemParamsWithHTTPClient(client *http.Client) *AddOrUpdateNodePoolConfigItemParams { - return &AddOrUpdateNodePoolConfigItemParams{ - HTTPClient: client, - } -} - -/* -AddOrUpdateNodePoolConfigItemParams contains all the parameters to send to the API endpoint - - for the add or update node pool config item operation. - - Typically these are written to a http.Request. -*/ -type AddOrUpdateNodePoolConfigItemParams struct { - - /* ClusterID. - - ID of the cluster. - */ - ClusterID string - - /* ConfigKey. - - Key for the config value. - */ - ConfigKey string - - /* NodePoolName. - - Name of the node pool. - */ - NodePoolName string - - /* Value. - - Config value. - */ - Value *models.ConfigValue - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the add or update node pool config item params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AddOrUpdateNodePoolConfigItemParams) WithDefaults() *AddOrUpdateNodePoolConfigItemParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the add or update node pool config item params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AddOrUpdateNodePoolConfigItemParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the add or update node pool config item params -func (o *AddOrUpdateNodePoolConfigItemParams) WithTimeout(timeout time.Duration) *AddOrUpdateNodePoolConfigItemParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the add or update node pool config item params -func (o *AddOrUpdateNodePoolConfigItemParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the add or update node pool config item params -func (o *AddOrUpdateNodePoolConfigItemParams) WithContext(ctx context.Context) *AddOrUpdateNodePoolConfigItemParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the add or update node pool config item params -func (o *AddOrUpdateNodePoolConfigItemParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the add or update node pool config item params -func (o *AddOrUpdateNodePoolConfigItemParams) WithHTTPClient(client *http.Client) *AddOrUpdateNodePoolConfigItemParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the add or update node pool config item params -func (o *AddOrUpdateNodePoolConfigItemParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithClusterID adds the clusterID to the add or update node pool config item params -func (o *AddOrUpdateNodePoolConfigItemParams) WithClusterID(clusterID string) *AddOrUpdateNodePoolConfigItemParams { - o.SetClusterID(clusterID) - return o -} - -// SetClusterID adds the clusterId to the add or update node pool config item params -func (o *AddOrUpdateNodePoolConfigItemParams) SetClusterID(clusterID string) { - o.ClusterID = clusterID -} - -// WithConfigKey adds the configKey to the add or update node pool config item params -func (o *AddOrUpdateNodePoolConfigItemParams) WithConfigKey(configKey string) *AddOrUpdateNodePoolConfigItemParams { - o.SetConfigKey(configKey) - return o -} - -// SetConfigKey adds the configKey to the add or update node pool config item params -func (o *AddOrUpdateNodePoolConfigItemParams) SetConfigKey(configKey string) { - o.ConfigKey = configKey -} - -// WithNodePoolName adds the nodePoolName to the add or update node pool config item params -func (o *AddOrUpdateNodePoolConfigItemParams) WithNodePoolName(nodePoolName string) *AddOrUpdateNodePoolConfigItemParams { - o.SetNodePoolName(nodePoolName) - return o -} - -// SetNodePoolName adds the nodePoolName to the add or update node pool config item params -func (o *AddOrUpdateNodePoolConfigItemParams) SetNodePoolName(nodePoolName string) { - o.NodePoolName = nodePoolName -} - -// WithValue adds the value to the add or update node pool config item params -func (o *AddOrUpdateNodePoolConfigItemParams) WithValue(value *models.ConfigValue) *AddOrUpdateNodePoolConfigItemParams { - o.SetValue(value) - return o -} - -// SetValue adds the value to the add or update node pool config item params -func (o *AddOrUpdateNodePoolConfigItemParams) SetValue(value *models.ConfigValue) { - o.Value = value -} - -// WriteToRequest writes these params to a swagger request -func (o *AddOrUpdateNodePoolConfigItemParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cluster_id - if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { - return err - } - - // path param config_key - if err := r.SetPathParam("config_key", o.ConfigKey); err != nil { - return err - } - - // path param node_pool_name - if err := r.SetPathParam("node_pool_name", o.NodePoolName); err != nil { - return err - } - if o.Value != nil { - if err := r.SetBodyParam(o.Value); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/cluster-registry/client/node_pool_config_items/add_or_update_node_pool_config_item_responses.go b/pkg/cluster-registry/client/node_pool_config_items/add_or_update_node_pool_config_item_responses.go deleted file mode 100644 index d76a2b7a..00000000 --- a/pkg/cluster-registry/client/node_pool_config_items/add_or_update_node_pool_config_item_responses.go +++ /dev/null @@ -1,382 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package node_pool_config_items - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/models" -) - -// AddOrUpdateNodePoolConfigItemReader is a Reader for the AddOrUpdateNodePoolConfigItem structure. -type AddOrUpdateNodePoolConfigItemReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *AddOrUpdateNodePoolConfigItemReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewAddOrUpdateNodePoolConfigItemOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewAddOrUpdateNodePoolConfigItemBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewAddOrUpdateNodePoolConfigItemUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewAddOrUpdateNodePoolConfigItemForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewAddOrUpdateNodePoolConfigItemInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}/config-items/{config_key}] addOrUpdateNodePoolConfigItem", response, response.Code()) - } -} - -// NewAddOrUpdateNodePoolConfigItemOK creates a AddOrUpdateNodePoolConfigItemOK with default headers values -func NewAddOrUpdateNodePoolConfigItemOK() *AddOrUpdateNodePoolConfigItemOK { - return &AddOrUpdateNodePoolConfigItemOK{} -} - -/* -AddOrUpdateNodePoolConfigItemOK describes a response with status code 200, with default header values. - -The config items add/update request is accepted. -*/ -type AddOrUpdateNodePoolConfigItemOK struct { - Payload *models.ConfigValue -} - -// IsSuccess returns true when this add or update node pool config item o k response has a 2xx status code -func (o *AddOrUpdateNodePoolConfigItemOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this add or update node pool config item o k response has a 3xx status code -func (o *AddOrUpdateNodePoolConfigItemOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this add or update node pool config item o k response has a 4xx status code -func (o *AddOrUpdateNodePoolConfigItemOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this add or update node pool config item o k response has a 5xx status code -func (o *AddOrUpdateNodePoolConfigItemOK) IsServerError() bool { - return false -} - -// IsCode returns true when this add or update node pool config item o k response a status code equal to that given -func (o *AddOrUpdateNodePoolConfigItemOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the add or update node pool config item o k response -func (o *AddOrUpdateNodePoolConfigItemOK) Code() int { - return 200 -} - -func (o *AddOrUpdateNodePoolConfigItemOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}/config-items/{config_key}][%d] addOrUpdateNodePoolConfigItemOK %s", 200, payload) -} - -func (o *AddOrUpdateNodePoolConfigItemOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}/config-items/{config_key}][%d] addOrUpdateNodePoolConfigItemOK %s", 200, payload) -} - -func (o *AddOrUpdateNodePoolConfigItemOK) GetPayload() *models.ConfigValue { - return o.Payload -} - -func (o *AddOrUpdateNodePoolConfigItemOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.ConfigValue) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewAddOrUpdateNodePoolConfigItemBadRequest creates a AddOrUpdateNodePoolConfigItemBadRequest with default headers values -func NewAddOrUpdateNodePoolConfigItemBadRequest() *AddOrUpdateNodePoolConfigItemBadRequest { - return &AddOrUpdateNodePoolConfigItemBadRequest{} -} - -/* -AddOrUpdateNodePoolConfigItemBadRequest describes a response with status code 400, with default header values. - -Invalid request -*/ -type AddOrUpdateNodePoolConfigItemBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this add or update node pool config item bad request response has a 2xx status code -func (o *AddOrUpdateNodePoolConfigItemBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this add or update node pool config item bad request response has a 3xx status code -func (o *AddOrUpdateNodePoolConfigItemBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this add or update node pool config item bad request response has a 4xx status code -func (o *AddOrUpdateNodePoolConfigItemBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this add or update node pool config item bad request response has a 5xx status code -func (o *AddOrUpdateNodePoolConfigItemBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this add or update node pool config item bad request response a status code equal to that given -func (o *AddOrUpdateNodePoolConfigItemBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the add or update node pool config item bad request response -func (o *AddOrUpdateNodePoolConfigItemBadRequest) Code() int { - return 400 -} - -func (o *AddOrUpdateNodePoolConfigItemBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}/config-items/{config_key}][%d] addOrUpdateNodePoolConfigItemBadRequest %s", 400, payload) -} - -func (o *AddOrUpdateNodePoolConfigItemBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}/config-items/{config_key}][%d] addOrUpdateNodePoolConfigItemBadRequest %s", 400, payload) -} - -func (o *AddOrUpdateNodePoolConfigItemBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *AddOrUpdateNodePoolConfigItemBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewAddOrUpdateNodePoolConfigItemUnauthorized creates a AddOrUpdateNodePoolConfigItemUnauthorized with default headers values -func NewAddOrUpdateNodePoolConfigItemUnauthorized() *AddOrUpdateNodePoolConfigItemUnauthorized { - return &AddOrUpdateNodePoolConfigItemUnauthorized{} -} - -/* -AddOrUpdateNodePoolConfigItemUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type AddOrUpdateNodePoolConfigItemUnauthorized struct { -} - -// IsSuccess returns true when this add or update node pool config item unauthorized response has a 2xx status code -func (o *AddOrUpdateNodePoolConfigItemUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this add or update node pool config item unauthorized response has a 3xx status code -func (o *AddOrUpdateNodePoolConfigItemUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this add or update node pool config item unauthorized response has a 4xx status code -func (o *AddOrUpdateNodePoolConfigItemUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this add or update node pool config item unauthorized response has a 5xx status code -func (o *AddOrUpdateNodePoolConfigItemUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this add or update node pool config item unauthorized response a status code equal to that given -func (o *AddOrUpdateNodePoolConfigItemUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the add or update node pool config item unauthorized response -func (o *AddOrUpdateNodePoolConfigItemUnauthorized) Code() int { - return 401 -} - -func (o *AddOrUpdateNodePoolConfigItemUnauthorized) Error() string { - return fmt.Sprintf("[PUT /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}/config-items/{config_key}][%d] addOrUpdateNodePoolConfigItemUnauthorized", 401) -} - -func (o *AddOrUpdateNodePoolConfigItemUnauthorized) String() string { - return fmt.Sprintf("[PUT /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}/config-items/{config_key}][%d] addOrUpdateNodePoolConfigItemUnauthorized", 401) -} - -func (o *AddOrUpdateNodePoolConfigItemUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewAddOrUpdateNodePoolConfigItemForbidden creates a AddOrUpdateNodePoolConfigItemForbidden with default headers values -func NewAddOrUpdateNodePoolConfigItemForbidden() *AddOrUpdateNodePoolConfigItemForbidden { - return &AddOrUpdateNodePoolConfigItemForbidden{} -} - -/* -AddOrUpdateNodePoolConfigItemForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type AddOrUpdateNodePoolConfigItemForbidden struct { -} - -// IsSuccess returns true when this add or update node pool config item forbidden response has a 2xx status code -func (o *AddOrUpdateNodePoolConfigItemForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this add or update node pool config item forbidden response has a 3xx status code -func (o *AddOrUpdateNodePoolConfigItemForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this add or update node pool config item forbidden response has a 4xx status code -func (o *AddOrUpdateNodePoolConfigItemForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this add or update node pool config item forbidden response has a 5xx status code -func (o *AddOrUpdateNodePoolConfigItemForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this add or update node pool config item forbidden response a status code equal to that given -func (o *AddOrUpdateNodePoolConfigItemForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the add or update node pool config item forbidden response -func (o *AddOrUpdateNodePoolConfigItemForbidden) Code() int { - return 403 -} - -func (o *AddOrUpdateNodePoolConfigItemForbidden) Error() string { - return fmt.Sprintf("[PUT /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}/config-items/{config_key}][%d] addOrUpdateNodePoolConfigItemForbidden", 403) -} - -func (o *AddOrUpdateNodePoolConfigItemForbidden) String() string { - return fmt.Sprintf("[PUT /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}/config-items/{config_key}][%d] addOrUpdateNodePoolConfigItemForbidden", 403) -} - -func (o *AddOrUpdateNodePoolConfigItemForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewAddOrUpdateNodePoolConfigItemInternalServerError creates a AddOrUpdateNodePoolConfigItemInternalServerError with default headers values -func NewAddOrUpdateNodePoolConfigItemInternalServerError() *AddOrUpdateNodePoolConfigItemInternalServerError { - return &AddOrUpdateNodePoolConfigItemInternalServerError{} -} - -/* -AddOrUpdateNodePoolConfigItemInternalServerError describes a response with status code 500, with default header values. - -Unexpected error -*/ -type AddOrUpdateNodePoolConfigItemInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this add or update node pool config item internal server error response has a 2xx status code -func (o *AddOrUpdateNodePoolConfigItemInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this add or update node pool config item internal server error response has a 3xx status code -func (o *AddOrUpdateNodePoolConfigItemInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this add or update node pool config item internal server error response has a 4xx status code -func (o *AddOrUpdateNodePoolConfigItemInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this add or update node pool config item internal server error response has a 5xx status code -func (o *AddOrUpdateNodePoolConfigItemInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this add or update node pool config item internal server error response a status code equal to that given -func (o *AddOrUpdateNodePoolConfigItemInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the add or update node pool config item internal server error response -func (o *AddOrUpdateNodePoolConfigItemInternalServerError) Code() int { - return 500 -} - -func (o *AddOrUpdateNodePoolConfigItemInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}/config-items/{config_key}][%d] addOrUpdateNodePoolConfigItemInternalServerError %s", 500, payload) -} - -func (o *AddOrUpdateNodePoolConfigItemInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}/config-items/{config_key}][%d] addOrUpdateNodePoolConfigItemInternalServerError %s", 500, payload) -} - -func (o *AddOrUpdateNodePoolConfigItemInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *AddOrUpdateNodePoolConfigItemInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/cluster-registry/client/node_pool_config_items/delete_node_pool_config_item_parameters.go b/pkg/cluster-registry/client/node_pool_config_items/delete_node_pool_config_item_parameters.go deleted file mode 100644 index 57ab9609..00000000 --- a/pkg/cluster-registry/client/node_pool_config_items/delete_node_pool_config_item_parameters.go +++ /dev/null @@ -1,195 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package node_pool_config_items - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteNodePoolConfigItemParams creates a new DeleteNodePoolConfigItemParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteNodePoolConfigItemParams() *DeleteNodePoolConfigItemParams { - return &DeleteNodePoolConfigItemParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteNodePoolConfigItemParamsWithTimeout creates a new DeleteNodePoolConfigItemParams object -// with the ability to set a timeout on a request. -func NewDeleteNodePoolConfigItemParamsWithTimeout(timeout time.Duration) *DeleteNodePoolConfigItemParams { - return &DeleteNodePoolConfigItemParams{ - timeout: timeout, - } -} - -// NewDeleteNodePoolConfigItemParamsWithContext creates a new DeleteNodePoolConfigItemParams object -// with the ability to set a context for a request. -func NewDeleteNodePoolConfigItemParamsWithContext(ctx context.Context) *DeleteNodePoolConfigItemParams { - return &DeleteNodePoolConfigItemParams{ - Context: ctx, - } -} - -// NewDeleteNodePoolConfigItemParamsWithHTTPClient creates a new DeleteNodePoolConfigItemParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteNodePoolConfigItemParamsWithHTTPClient(client *http.Client) *DeleteNodePoolConfigItemParams { - return &DeleteNodePoolConfigItemParams{ - HTTPClient: client, - } -} - -/* -DeleteNodePoolConfigItemParams contains all the parameters to send to the API endpoint - - for the delete node pool config item operation. - - Typically these are written to a http.Request. -*/ -type DeleteNodePoolConfigItemParams struct { - - /* ClusterID. - - ID of the cluster. - */ - ClusterID string - - /* ConfigKey. - - Key for the config value. - */ - ConfigKey string - - /* NodePoolName. - - Name of the node pool. - */ - NodePoolName string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete node pool config item params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteNodePoolConfigItemParams) WithDefaults() *DeleteNodePoolConfigItemParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete node pool config item params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteNodePoolConfigItemParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete node pool config item params -func (o *DeleteNodePoolConfigItemParams) WithTimeout(timeout time.Duration) *DeleteNodePoolConfigItemParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete node pool config item params -func (o *DeleteNodePoolConfigItemParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete node pool config item params -func (o *DeleteNodePoolConfigItemParams) WithContext(ctx context.Context) *DeleteNodePoolConfigItemParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete node pool config item params -func (o *DeleteNodePoolConfigItemParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete node pool config item params -func (o *DeleteNodePoolConfigItemParams) WithHTTPClient(client *http.Client) *DeleteNodePoolConfigItemParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete node pool config item params -func (o *DeleteNodePoolConfigItemParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithClusterID adds the clusterID to the delete node pool config item params -func (o *DeleteNodePoolConfigItemParams) WithClusterID(clusterID string) *DeleteNodePoolConfigItemParams { - o.SetClusterID(clusterID) - return o -} - -// SetClusterID adds the clusterId to the delete node pool config item params -func (o *DeleteNodePoolConfigItemParams) SetClusterID(clusterID string) { - o.ClusterID = clusterID -} - -// WithConfigKey adds the configKey to the delete node pool config item params -func (o *DeleteNodePoolConfigItemParams) WithConfigKey(configKey string) *DeleteNodePoolConfigItemParams { - o.SetConfigKey(configKey) - return o -} - -// SetConfigKey adds the configKey to the delete node pool config item params -func (o *DeleteNodePoolConfigItemParams) SetConfigKey(configKey string) { - o.ConfigKey = configKey -} - -// WithNodePoolName adds the nodePoolName to the delete node pool config item params -func (o *DeleteNodePoolConfigItemParams) WithNodePoolName(nodePoolName string) *DeleteNodePoolConfigItemParams { - o.SetNodePoolName(nodePoolName) - return o -} - -// SetNodePoolName adds the nodePoolName to the delete node pool config item params -func (o *DeleteNodePoolConfigItemParams) SetNodePoolName(nodePoolName string) { - o.NodePoolName = nodePoolName -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteNodePoolConfigItemParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cluster_id - if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { - return err - } - - // path param config_key - if err := r.SetPathParam("config_key", o.ConfigKey); err != nil { - return err - } - - // path param node_pool_name - if err := r.SetPathParam("node_pool_name", o.NodePoolName); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/cluster-registry/client/node_pool_config_items/delete_node_pool_config_item_responses.go b/pkg/cluster-registry/client/node_pool_config_items/delete_node_pool_config_item_responses.go deleted file mode 100644 index 7248db87..00000000 --- a/pkg/cluster-registry/client/node_pool_config_items/delete_node_pool_config_item_responses.go +++ /dev/null @@ -1,430 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package node_pool_config_items - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/models" -) - -// DeleteNodePoolConfigItemReader is a Reader for the DeleteNodePoolConfigItem structure. -type DeleteNodePoolConfigItemReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteNodePoolConfigItemReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 204: - result := NewDeleteNodePoolConfigItemNoContent() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewDeleteNodePoolConfigItemBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewDeleteNodePoolConfigItemUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewDeleteNodePoolConfigItemForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDeleteNodePoolConfigItemNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewDeleteNodePoolConfigItemInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}/config-items/{config_key}] deleteNodePoolConfigItem", response, response.Code()) - } -} - -// NewDeleteNodePoolConfigItemNoContent creates a DeleteNodePoolConfigItemNoContent with default headers values -func NewDeleteNodePoolConfigItemNoContent() *DeleteNodePoolConfigItemNoContent { - return &DeleteNodePoolConfigItemNoContent{} -} - -/* -DeleteNodePoolConfigItemNoContent describes a response with status code 204, with default header values. - -Config item deleted. -*/ -type DeleteNodePoolConfigItemNoContent struct { -} - -// IsSuccess returns true when this delete node pool config item no content response has a 2xx status code -func (o *DeleteNodePoolConfigItemNoContent) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this delete node pool config item no content response has a 3xx status code -func (o *DeleteNodePoolConfigItemNoContent) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete node pool config item no content response has a 4xx status code -func (o *DeleteNodePoolConfigItemNoContent) IsClientError() bool { - return false -} - -// IsServerError returns true when this delete node pool config item no content response has a 5xx status code -func (o *DeleteNodePoolConfigItemNoContent) IsServerError() bool { - return false -} - -// IsCode returns true when this delete node pool config item no content response a status code equal to that given -func (o *DeleteNodePoolConfigItemNoContent) IsCode(code int) bool { - return code == 204 -} - -// Code gets the status code for the delete node pool config item no content response -func (o *DeleteNodePoolConfigItemNoContent) Code() int { - return 204 -} - -func (o *DeleteNodePoolConfigItemNoContent) Error() string { - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}/config-items/{config_key}][%d] deleteNodePoolConfigItemNoContent", 204) -} - -func (o *DeleteNodePoolConfigItemNoContent) String() string { - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}/config-items/{config_key}][%d] deleteNodePoolConfigItemNoContent", 204) -} - -func (o *DeleteNodePoolConfigItemNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewDeleteNodePoolConfigItemBadRequest creates a DeleteNodePoolConfigItemBadRequest with default headers values -func NewDeleteNodePoolConfigItemBadRequest() *DeleteNodePoolConfigItemBadRequest { - return &DeleteNodePoolConfigItemBadRequest{} -} - -/* -DeleteNodePoolConfigItemBadRequest describes a response with status code 400, with default header values. - -Invalid request -*/ -type DeleteNodePoolConfigItemBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this delete node pool config item bad request response has a 2xx status code -func (o *DeleteNodePoolConfigItemBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this delete node pool config item bad request response has a 3xx status code -func (o *DeleteNodePoolConfigItemBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete node pool config item bad request response has a 4xx status code -func (o *DeleteNodePoolConfigItemBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this delete node pool config item bad request response has a 5xx status code -func (o *DeleteNodePoolConfigItemBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this delete node pool config item bad request response a status code equal to that given -func (o *DeleteNodePoolConfigItemBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the delete node pool config item bad request response -func (o *DeleteNodePoolConfigItemBadRequest) Code() int { - return 400 -} - -func (o *DeleteNodePoolConfigItemBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}/config-items/{config_key}][%d] deleteNodePoolConfigItemBadRequest %s", 400, payload) -} - -func (o *DeleteNodePoolConfigItemBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}/config-items/{config_key}][%d] deleteNodePoolConfigItemBadRequest %s", 400, payload) -} - -func (o *DeleteNodePoolConfigItemBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *DeleteNodePoolConfigItemBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteNodePoolConfigItemUnauthorized creates a DeleteNodePoolConfigItemUnauthorized with default headers values -func NewDeleteNodePoolConfigItemUnauthorized() *DeleteNodePoolConfigItemUnauthorized { - return &DeleteNodePoolConfigItemUnauthorized{} -} - -/* -DeleteNodePoolConfigItemUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type DeleteNodePoolConfigItemUnauthorized struct { -} - -// IsSuccess returns true when this delete node pool config item unauthorized response has a 2xx status code -func (o *DeleteNodePoolConfigItemUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this delete node pool config item unauthorized response has a 3xx status code -func (o *DeleteNodePoolConfigItemUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete node pool config item unauthorized response has a 4xx status code -func (o *DeleteNodePoolConfigItemUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this delete node pool config item unauthorized response has a 5xx status code -func (o *DeleteNodePoolConfigItemUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this delete node pool config item unauthorized response a status code equal to that given -func (o *DeleteNodePoolConfigItemUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the delete node pool config item unauthorized response -func (o *DeleteNodePoolConfigItemUnauthorized) Code() int { - return 401 -} - -func (o *DeleteNodePoolConfigItemUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}/config-items/{config_key}][%d] deleteNodePoolConfigItemUnauthorized", 401) -} - -func (o *DeleteNodePoolConfigItemUnauthorized) String() string { - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}/config-items/{config_key}][%d] deleteNodePoolConfigItemUnauthorized", 401) -} - -func (o *DeleteNodePoolConfigItemUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewDeleteNodePoolConfigItemForbidden creates a DeleteNodePoolConfigItemForbidden with default headers values -func NewDeleteNodePoolConfigItemForbidden() *DeleteNodePoolConfigItemForbidden { - return &DeleteNodePoolConfigItemForbidden{} -} - -/* -DeleteNodePoolConfigItemForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type DeleteNodePoolConfigItemForbidden struct { -} - -// IsSuccess returns true when this delete node pool config item forbidden response has a 2xx status code -func (o *DeleteNodePoolConfigItemForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this delete node pool config item forbidden response has a 3xx status code -func (o *DeleteNodePoolConfigItemForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete node pool config item forbidden response has a 4xx status code -func (o *DeleteNodePoolConfigItemForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this delete node pool config item forbidden response has a 5xx status code -func (o *DeleteNodePoolConfigItemForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this delete node pool config item forbidden response a status code equal to that given -func (o *DeleteNodePoolConfigItemForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the delete node pool config item forbidden response -func (o *DeleteNodePoolConfigItemForbidden) Code() int { - return 403 -} - -func (o *DeleteNodePoolConfigItemForbidden) Error() string { - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}/config-items/{config_key}][%d] deleteNodePoolConfigItemForbidden", 403) -} - -func (o *DeleteNodePoolConfigItemForbidden) String() string { - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}/config-items/{config_key}][%d] deleteNodePoolConfigItemForbidden", 403) -} - -func (o *DeleteNodePoolConfigItemForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewDeleteNodePoolConfigItemNotFound creates a DeleteNodePoolConfigItemNotFound with default headers values -func NewDeleteNodePoolConfigItemNotFound() *DeleteNodePoolConfigItemNotFound { - return &DeleteNodePoolConfigItemNotFound{} -} - -/* -DeleteNodePoolConfigItemNotFound describes a response with status code 404, with default header values. - -Config item not found -*/ -type DeleteNodePoolConfigItemNotFound struct { -} - -// IsSuccess returns true when this delete node pool config item not found response has a 2xx status code -func (o *DeleteNodePoolConfigItemNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this delete node pool config item not found response has a 3xx status code -func (o *DeleteNodePoolConfigItemNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete node pool config item not found response has a 4xx status code -func (o *DeleteNodePoolConfigItemNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this delete node pool config item not found response has a 5xx status code -func (o *DeleteNodePoolConfigItemNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this delete node pool config item not found response a status code equal to that given -func (o *DeleteNodePoolConfigItemNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the delete node pool config item not found response -func (o *DeleteNodePoolConfigItemNotFound) Code() int { - return 404 -} - -func (o *DeleteNodePoolConfigItemNotFound) Error() string { - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}/config-items/{config_key}][%d] deleteNodePoolConfigItemNotFound", 404) -} - -func (o *DeleteNodePoolConfigItemNotFound) String() string { - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}/config-items/{config_key}][%d] deleteNodePoolConfigItemNotFound", 404) -} - -func (o *DeleteNodePoolConfigItemNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewDeleteNodePoolConfigItemInternalServerError creates a DeleteNodePoolConfigItemInternalServerError with default headers values -func NewDeleteNodePoolConfigItemInternalServerError() *DeleteNodePoolConfigItemInternalServerError { - return &DeleteNodePoolConfigItemInternalServerError{} -} - -/* -DeleteNodePoolConfigItemInternalServerError describes a response with status code 500, with default header values. - -Unexpected error -*/ -type DeleteNodePoolConfigItemInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this delete node pool config item internal server error response has a 2xx status code -func (o *DeleteNodePoolConfigItemInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this delete node pool config item internal server error response has a 3xx status code -func (o *DeleteNodePoolConfigItemInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete node pool config item internal server error response has a 4xx status code -func (o *DeleteNodePoolConfigItemInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this delete node pool config item internal server error response has a 5xx status code -func (o *DeleteNodePoolConfigItemInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this delete node pool config item internal server error response a status code equal to that given -func (o *DeleteNodePoolConfigItemInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the delete node pool config item internal server error response -func (o *DeleteNodePoolConfigItemInternalServerError) Code() int { - return 500 -} - -func (o *DeleteNodePoolConfigItemInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}/config-items/{config_key}][%d] deleteNodePoolConfigItemInternalServerError %s", 500, payload) -} - -func (o *DeleteNodePoolConfigItemInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}/config-items/{config_key}][%d] deleteNodePoolConfigItemInternalServerError %s", 500, payload) -} - -func (o *DeleteNodePoolConfigItemInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *DeleteNodePoolConfigItemInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/cluster-registry/client/node_pool_config_items/node_pool_config_items_client.go b/pkg/cluster-registry/client/node_pool_config_items/node_pool_config_items_client.go deleted file mode 100644 index c96e8fb3..00000000 --- a/pkg/cluster-registry/client/node_pool_config_items/node_pool_config_items_client.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package node_pool_config_items - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new node pool config items API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new node pool config items API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new node pool config items API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for node pool config items API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - AddOrUpdateNodePoolConfigItem(params *AddOrUpdateNodePoolConfigItemParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AddOrUpdateNodePoolConfigItemOK, error) - - DeleteNodePoolConfigItem(params *DeleteNodePoolConfigItemParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteNodePoolConfigItemNoContent, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -AddOrUpdateNodePoolConfigItem adds update config item - -Add/update a configuration item unique to the node pool. -*/ -func (a *Client) AddOrUpdateNodePoolConfigItem(params *AddOrUpdateNodePoolConfigItemParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AddOrUpdateNodePoolConfigItemOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewAddOrUpdateNodePoolConfigItemParams() - } - op := &runtime.ClientOperation{ - ID: "addOrUpdateNodePoolConfigItem", - Method: "PUT", - PathPattern: "/kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}/config-items/{config_key}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &AddOrUpdateNodePoolConfigItemReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*AddOrUpdateNodePoolConfigItemOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for addOrUpdateNodePoolConfigItem: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -DeleteNodePoolConfigItem deletes config item - -Deletes config item. -*/ -func (a *Client) DeleteNodePoolConfigItem(params *DeleteNodePoolConfigItemParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteNodePoolConfigItemNoContent, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteNodePoolConfigItemParams() - } - op := &runtime.ClientOperation{ - ID: "deleteNodePoolConfigItem", - Method: "DELETE", - PathPattern: "/kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}/config-items/{config_key}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DeleteNodePoolConfigItemReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteNodePoolConfigItemNoContent) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteNodePoolConfigItem: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/pkg/cluster-registry/client/node_pools/create_or_update_node_pool_parameters.go b/pkg/cluster-registry/client/node_pools/create_or_update_node_pool_parameters.go deleted file mode 100644 index bb5fd715..00000000 --- a/pkg/cluster-registry/client/node_pools/create_or_update_node_pool_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package node_pools - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/models" -) - -// NewCreateOrUpdateNodePoolParams creates a new CreateOrUpdateNodePoolParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateOrUpdateNodePoolParams() *CreateOrUpdateNodePoolParams { - return &CreateOrUpdateNodePoolParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateOrUpdateNodePoolParamsWithTimeout creates a new CreateOrUpdateNodePoolParams object -// with the ability to set a timeout on a request. -func NewCreateOrUpdateNodePoolParamsWithTimeout(timeout time.Duration) *CreateOrUpdateNodePoolParams { - return &CreateOrUpdateNodePoolParams{ - timeout: timeout, - } -} - -// NewCreateOrUpdateNodePoolParamsWithContext creates a new CreateOrUpdateNodePoolParams object -// with the ability to set a context for a request. -func NewCreateOrUpdateNodePoolParamsWithContext(ctx context.Context) *CreateOrUpdateNodePoolParams { - return &CreateOrUpdateNodePoolParams{ - Context: ctx, - } -} - -// NewCreateOrUpdateNodePoolParamsWithHTTPClient creates a new CreateOrUpdateNodePoolParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateOrUpdateNodePoolParamsWithHTTPClient(client *http.Client) *CreateOrUpdateNodePoolParams { - return &CreateOrUpdateNodePoolParams{ - HTTPClient: client, - } -} - -/* -CreateOrUpdateNodePoolParams contains all the parameters to send to the API endpoint - - for the create or update node pool operation. - - Typically these are written to a http.Request. -*/ -type CreateOrUpdateNodePoolParams struct { - - /* ClusterID. - - ID of the cluster. - */ - ClusterID string - - /* NodePool. - - Node pool to be created. - */ - NodePool *models.NodePool - - /* NodePoolName. - - Name of the node pool. - */ - NodePoolName string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create or update node pool params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateOrUpdateNodePoolParams) WithDefaults() *CreateOrUpdateNodePoolParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create or update node pool params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateOrUpdateNodePoolParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create or update node pool params -func (o *CreateOrUpdateNodePoolParams) WithTimeout(timeout time.Duration) *CreateOrUpdateNodePoolParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create or update node pool params -func (o *CreateOrUpdateNodePoolParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create or update node pool params -func (o *CreateOrUpdateNodePoolParams) WithContext(ctx context.Context) *CreateOrUpdateNodePoolParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create or update node pool params -func (o *CreateOrUpdateNodePoolParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create or update node pool params -func (o *CreateOrUpdateNodePoolParams) WithHTTPClient(client *http.Client) *CreateOrUpdateNodePoolParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create or update node pool params -func (o *CreateOrUpdateNodePoolParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithClusterID adds the clusterID to the create or update node pool params -func (o *CreateOrUpdateNodePoolParams) WithClusterID(clusterID string) *CreateOrUpdateNodePoolParams { - o.SetClusterID(clusterID) - return o -} - -// SetClusterID adds the clusterId to the create or update node pool params -func (o *CreateOrUpdateNodePoolParams) SetClusterID(clusterID string) { - o.ClusterID = clusterID -} - -// WithNodePool adds the nodePool to the create or update node pool params -func (o *CreateOrUpdateNodePoolParams) WithNodePool(nodePool *models.NodePool) *CreateOrUpdateNodePoolParams { - o.SetNodePool(nodePool) - return o -} - -// SetNodePool adds the nodePool to the create or update node pool params -func (o *CreateOrUpdateNodePoolParams) SetNodePool(nodePool *models.NodePool) { - o.NodePool = nodePool -} - -// WithNodePoolName adds the nodePoolName to the create or update node pool params -func (o *CreateOrUpdateNodePoolParams) WithNodePoolName(nodePoolName string) *CreateOrUpdateNodePoolParams { - o.SetNodePoolName(nodePoolName) - return o -} - -// SetNodePoolName adds the nodePoolName to the create or update node pool params -func (o *CreateOrUpdateNodePoolParams) SetNodePoolName(nodePoolName string) { - o.NodePoolName = nodePoolName -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateOrUpdateNodePoolParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cluster_id - if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { - return err - } - if o.NodePool != nil { - if err := r.SetBodyParam(o.NodePool); err != nil { - return err - } - } - - // path param node_pool_name - if err := r.SetPathParam("node_pool_name", o.NodePoolName); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/cluster-registry/client/node_pools/create_or_update_node_pool_responses.go b/pkg/cluster-registry/client/node_pools/create_or_update_node_pool_responses.go deleted file mode 100644 index e76848a5..00000000 --- a/pkg/cluster-registry/client/node_pools/create_or_update_node_pool_responses.go +++ /dev/null @@ -1,382 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package node_pools - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/models" -) - -// CreateOrUpdateNodePoolReader is a Reader for the CreateOrUpdateNodePool structure. -type CreateOrUpdateNodePoolReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateOrUpdateNodePoolReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewCreateOrUpdateNodePoolOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateOrUpdateNodePoolBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreateOrUpdateNodePoolUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewCreateOrUpdateNodePoolForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewCreateOrUpdateNodePoolInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}] createOrUpdateNodePool", response, response.Code()) - } -} - -// NewCreateOrUpdateNodePoolOK creates a CreateOrUpdateNodePoolOK with default headers values -func NewCreateOrUpdateNodePoolOK() *CreateOrUpdateNodePoolOK { - return &CreateOrUpdateNodePoolOK{} -} - -/* -CreateOrUpdateNodePoolOK describes a response with status code 200, with default header values. - -The node pool create request is accepted. -*/ -type CreateOrUpdateNodePoolOK struct { - Payload *models.NodePool -} - -// IsSuccess returns true when this create or update node pool o k response has a 2xx status code -func (o *CreateOrUpdateNodePoolOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this create or update node pool o k response has a 3xx status code -func (o *CreateOrUpdateNodePoolOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create or update node pool o k response has a 4xx status code -func (o *CreateOrUpdateNodePoolOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this create or update node pool o k response has a 5xx status code -func (o *CreateOrUpdateNodePoolOK) IsServerError() bool { - return false -} - -// IsCode returns true when this create or update node pool o k response a status code equal to that given -func (o *CreateOrUpdateNodePoolOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the create or update node pool o k response -func (o *CreateOrUpdateNodePoolOK) Code() int { - return 200 -} - -func (o *CreateOrUpdateNodePoolOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}][%d] createOrUpdateNodePoolOK %s", 200, payload) -} - -func (o *CreateOrUpdateNodePoolOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}][%d] createOrUpdateNodePoolOK %s", 200, payload) -} - -func (o *CreateOrUpdateNodePoolOK) GetPayload() *models.NodePool { - return o.Payload -} - -func (o *CreateOrUpdateNodePoolOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.NodePool) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateOrUpdateNodePoolBadRequest creates a CreateOrUpdateNodePoolBadRequest with default headers values -func NewCreateOrUpdateNodePoolBadRequest() *CreateOrUpdateNodePoolBadRequest { - return &CreateOrUpdateNodePoolBadRequest{} -} - -/* -CreateOrUpdateNodePoolBadRequest describes a response with status code 400, with default header values. - -Invalid request -*/ -type CreateOrUpdateNodePoolBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this create or update node pool bad request response has a 2xx status code -func (o *CreateOrUpdateNodePoolBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create or update node pool bad request response has a 3xx status code -func (o *CreateOrUpdateNodePoolBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create or update node pool bad request response has a 4xx status code -func (o *CreateOrUpdateNodePoolBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this create or update node pool bad request response has a 5xx status code -func (o *CreateOrUpdateNodePoolBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this create or update node pool bad request response a status code equal to that given -func (o *CreateOrUpdateNodePoolBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the create or update node pool bad request response -func (o *CreateOrUpdateNodePoolBadRequest) Code() int { - return 400 -} - -func (o *CreateOrUpdateNodePoolBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}][%d] createOrUpdateNodePoolBadRequest %s", 400, payload) -} - -func (o *CreateOrUpdateNodePoolBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}][%d] createOrUpdateNodePoolBadRequest %s", 400, payload) -} - -func (o *CreateOrUpdateNodePoolBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateOrUpdateNodePoolBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateOrUpdateNodePoolUnauthorized creates a CreateOrUpdateNodePoolUnauthorized with default headers values -func NewCreateOrUpdateNodePoolUnauthorized() *CreateOrUpdateNodePoolUnauthorized { - return &CreateOrUpdateNodePoolUnauthorized{} -} - -/* -CreateOrUpdateNodePoolUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type CreateOrUpdateNodePoolUnauthorized struct { -} - -// IsSuccess returns true when this create or update node pool unauthorized response has a 2xx status code -func (o *CreateOrUpdateNodePoolUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create or update node pool unauthorized response has a 3xx status code -func (o *CreateOrUpdateNodePoolUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create or update node pool unauthorized response has a 4xx status code -func (o *CreateOrUpdateNodePoolUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this create or update node pool unauthorized response has a 5xx status code -func (o *CreateOrUpdateNodePoolUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this create or update node pool unauthorized response a status code equal to that given -func (o *CreateOrUpdateNodePoolUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the create or update node pool unauthorized response -func (o *CreateOrUpdateNodePoolUnauthorized) Code() int { - return 401 -} - -func (o *CreateOrUpdateNodePoolUnauthorized) Error() string { - return fmt.Sprintf("[PUT /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}][%d] createOrUpdateNodePoolUnauthorized", 401) -} - -func (o *CreateOrUpdateNodePoolUnauthorized) String() string { - return fmt.Sprintf("[PUT /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}][%d] createOrUpdateNodePoolUnauthorized", 401) -} - -func (o *CreateOrUpdateNodePoolUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewCreateOrUpdateNodePoolForbidden creates a CreateOrUpdateNodePoolForbidden with default headers values -func NewCreateOrUpdateNodePoolForbidden() *CreateOrUpdateNodePoolForbidden { - return &CreateOrUpdateNodePoolForbidden{} -} - -/* -CreateOrUpdateNodePoolForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type CreateOrUpdateNodePoolForbidden struct { -} - -// IsSuccess returns true when this create or update node pool forbidden response has a 2xx status code -func (o *CreateOrUpdateNodePoolForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create or update node pool forbidden response has a 3xx status code -func (o *CreateOrUpdateNodePoolForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create or update node pool forbidden response has a 4xx status code -func (o *CreateOrUpdateNodePoolForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this create or update node pool forbidden response has a 5xx status code -func (o *CreateOrUpdateNodePoolForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this create or update node pool forbidden response a status code equal to that given -func (o *CreateOrUpdateNodePoolForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the create or update node pool forbidden response -func (o *CreateOrUpdateNodePoolForbidden) Code() int { - return 403 -} - -func (o *CreateOrUpdateNodePoolForbidden) Error() string { - return fmt.Sprintf("[PUT /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}][%d] createOrUpdateNodePoolForbidden", 403) -} - -func (o *CreateOrUpdateNodePoolForbidden) String() string { - return fmt.Sprintf("[PUT /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}][%d] createOrUpdateNodePoolForbidden", 403) -} - -func (o *CreateOrUpdateNodePoolForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewCreateOrUpdateNodePoolInternalServerError creates a CreateOrUpdateNodePoolInternalServerError with default headers values -func NewCreateOrUpdateNodePoolInternalServerError() *CreateOrUpdateNodePoolInternalServerError { - return &CreateOrUpdateNodePoolInternalServerError{} -} - -/* -CreateOrUpdateNodePoolInternalServerError describes a response with status code 500, with default header values. - -Unexpected error -*/ -type CreateOrUpdateNodePoolInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this create or update node pool internal server error response has a 2xx status code -func (o *CreateOrUpdateNodePoolInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create or update node pool internal server error response has a 3xx status code -func (o *CreateOrUpdateNodePoolInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create or update node pool internal server error response has a 4xx status code -func (o *CreateOrUpdateNodePoolInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this create or update node pool internal server error response has a 5xx status code -func (o *CreateOrUpdateNodePoolInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this create or update node pool internal server error response a status code equal to that given -func (o *CreateOrUpdateNodePoolInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the create or update node pool internal server error response -func (o *CreateOrUpdateNodePoolInternalServerError) Code() int { - return 500 -} - -func (o *CreateOrUpdateNodePoolInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}][%d] createOrUpdateNodePoolInternalServerError %s", 500, payload) -} - -func (o *CreateOrUpdateNodePoolInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PUT /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}][%d] createOrUpdateNodePoolInternalServerError %s", 500, payload) -} - -func (o *CreateOrUpdateNodePoolInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *CreateOrUpdateNodePoolInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/cluster-registry/client/node_pools/delete_node_pool_parameters.go b/pkg/cluster-registry/client/node_pools/delete_node_pool_parameters.go deleted file mode 100644 index 9acd1d2e..00000000 --- a/pkg/cluster-registry/client/node_pools/delete_node_pool_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package node_pools - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteNodePoolParams creates a new DeleteNodePoolParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteNodePoolParams() *DeleteNodePoolParams { - return &DeleteNodePoolParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteNodePoolParamsWithTimeout creates a new DeleteNodePoolParams object -// with the ability to set a timeout on a request. -func NewDeleteNodePoolParamsWithTimeout(timeout time.Duration) *DeleteNodePoolParams { - return &DeleteNodePoolParams{ - timeout: timeout, - } -} - -// NewDeleteNodePoolParamsWithContext creates a new DeleteNodePoolParams object -// with the ability to set a context for a request. -func NewDeleteNodePoolParamsWithContext(ctx context.Context) *DeleteNodePoolParams { - return &DeleteNodePoolParams{ - Context: ctx, - } -} - -// NewDeleteNodePoolParamsWithHTTPClient creates a new DeleteNodePoolParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteNodePoolParamsWithHTTPClient(client *http.Client) *DeleteNodePoolParams { - return &DeleteNodePoolParams{ - HTTPClient: client, - } -} - -/* -DeleteNodePoolParams contains all the parameters to send to the API endpoint - - for the delete node pool operation. - - Typically these are written to a http.Request. -*/ -type DeleteNodePoolParams struct { - - /* ClusterID. - - ID of the cluster. - */ - ClusterID string - - /* NodePoolName. - - Name of the node pool. - */ - NodePoolName string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete node pool params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteNodePoolParams) WithDefaults() *DeleteNodePoolParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete node pool params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteNodePoolParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete node pool params -func (o *DeleteNodePoolParams) WithTimeout(timeout time.Duration) *DeleteNodePoolParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete node pool params -func (o *DeleteNodePoolParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete node pool params -func (o *DeleteNodePoolParams) WithContext(ctx context.Context) *DeleteNodePoolParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete node pool params -func (o *DeleteNodePoolParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete node pool params -func (o *DeleteNodePoolParams) WithHTTPClient(client *http.Client) *DeleteNodePoolParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete node pool params -func (o *DeleteNodePoolParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithClusterID adds the clusterID to the delete node pool params -func (o *DeleteNodePoolParams) WithClusterID(clusterID string) *DeleteNodePoolParams { - o.SetClusterID(clusterID) - return o -} - -// SetClusterID adds the clusterId to the delete node pool params -func (o *DeleteNodePoolParams) SetClusterID(clusterID string) { - o.ClusterID = clusterID -} - -// WithNodePoolName adds the nodePoolName to the delete node pool params -func (o *DeleteNodePoolParams) WithNodePoolName(nodePoolName string) *DeleteNodePoolParams { - o.SetNodePoolName(nodePoolName) - return o -} - -// SetNodePoolName adds the nodePoolName to the delete node pool params -func (o *DeleteNodePoolParams) SetNodePoolName(nodePoolName string) { - o.NodePoolName = nodePoolName -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteNodePoolParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cluster_id - if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { - return err - } - - // path param node_pool_name - if err := r.SetPathParam("node_pool_name", o.NodePoolName); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/cluster-registry/client/node_pools/delete_node_pool_responses.go b/pkg/cluster-registry/client/node_pools/delete_node_pool_responses.go deleted file mode 100644 index aed46583..00000000 --- a/pkg/cluster-registry/client/node_pools/delete_node_pool_responses.go +++ /dev/null @@ -1,430 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package node_pools - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/models" -) - -// DeleteNodePoolReader is a Reader for the DeleteNodePool structure. -type DeleteNodePoolReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteNodePoolReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 204: - result := NewDeleteNodePoolNoContent() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewDeleteNodePoolBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewDeleteNodePoolUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewDeleteNodePoolForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDeleteNodePoolNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewDeleteNodePoolInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}] deleteNodePool", response, response.Code()) - } -} - -// NewDeleteNodePoolNoContent creates a DeleteNodePoolNoContent with default headers values -func NewDeleteNodePoolNoContent() *DeleteNodePoolNoContent { - return &DeleteNodePoolNoContent{} -} - -/* -DeleteNodePoolNoContent describes a response with status code 204, with default header values. - -Node pool deleted. -*/ -type DeleteNodePoolNoContent struct { -} - -// IsSuccess returns true when this delete node pool no content response has a 2xx status code -func (o *DeleteNodePoolNoContent) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this delete node pool no content response has a 3xx status code -func (o *DeleteNodePoolNoContent) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete node pool no content response has a 4xx status code -func (o *DeleteNodePoolNoContent) IsClientError() bool { - return false -} - -// IsServerError returns true when this delete node pool no content response has a 5xx status code -func (o *DeleteNodePoolNoContent) IsServerError() bool { - return false -} - -// IsCode returns true when this delete node pool no content response a status code equal to that given -func (o *DeleteNodePoolNoContent) IsCode(code int) bool { - return code == 204 -} - -// Code gets the status code for the delete node pool no content response -func (o *DeleteNodePoolNoContent) Code() int { - return 204 -} - -func (o *DeleteNodePoolNoContent) Error() string { - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}][%d] deleteNodePoolNoContent", 204) -} - -func (o *DeleteNodePoolNoContent) String() string { - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}][%d] deleteNodePoolNoContent", 204) -} - -func (o *DeleteNodePoolNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewDeleteNodePoolBadRequest creates a DeleteNodePoolBadRequest with default headers values -func NewDeleteNodePoolBadRequest() *DeleteNodePoolBadRequest { - return &DeleteNodePoolBadRequest{} -} - -/* -DeleteNodePoolBadRequest describes a response with status code 400, with default header values. - -Invalid request -*/ -type DeleteNodePoolBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this delete node pool bad request response has a 2xx status code -func (o *DeleteNodePoolBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this delete node pool bad request response has a 3xx status code -func (o *DeleteNodePoolBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete node pool bad request response has a 4xx status code -func (o *DeleteNodePoolBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this delete node pool bad request response has a 5xx status code -func (o *DeleteNodePoolBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this delete node pool bad request response a status code equal to that given -func (o *DeleteNodePoolBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the delete node pool bad request response -func (o *DeleteNodePoolBadRequest) Code() int { - return 400 -} - -func (o *DeleteNodePoolBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}][%d] deleteNodePoolBadRequest %s", 400, payload) -} - -func (o *DeleteNodePoolBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}][%d] deleteNodePoolBadRequest %s", 400, payload) -} - -func (o *DeleteNodePoolBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *DeleteNodePoolBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteNodePoolUnauthorized creates a DeleteNodePoolUnauthorized with default headers values -func NewDeleteNodePoolUnauthorized() *DeleteNodePoolUnauthorized { - return &DeleteNodePoolUnauthorized{} -} - -/* -DeleteNodePoolUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type DeleteNodePoolUnauthorized struct { -} - -// IsSuccess returns true when this delete node pool unauthorized response has a 2xx status code -func (o *DeleteNodePoolUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this delete node pool unauthorized response has a 3xx status code -func (o *DeleteNodePoolUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete node pool unauthorized response has a 4xx status code -func (o *DeleteNodePoolUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this delete node pool unauthorized response has a 5xx status code -func (o *DeleteNodePoolUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this delete node pool unauthorized response a status code equal to that given -func (o *DeleteNodePoolUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the delete node pool unauthorized response -func (o *DeleteNodePoolUnauthorized) Code() int { - return 401 -} - -func (o *DeleteNodePoolUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}][%d] deleteNodePoolUnauthorized", 401) -} - -func (o *DeleteNodePoolUnauthorized) String() string { - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}][%d] deleteNodePoolUnauthorized", 401) -} - -func (o *DeleteNodePoolUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewDeleteNodePoolForbidden creates a DeleteNodePoolForbidden with default headers values -func NewDeleteNodePoolForbidden() *DeleteNodePoolForbidden { - return &DeleteNodePoolForbidden{} -} - -/* -DeleteNodePoolForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type DeleteNodePoolForbidden struct { -} - -// IsSuccess returns true when this delete node pool forbidden response has a 2xx status code -func (o *DeleteNodePoolForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this delete node pool forbidden response has a 3xx status code -func (o *DeleteNodePoolForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete node pool forbidden response has a 4xx status code -func (o *DeleteNodePoolForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this delete node pool forbidden response has a 5xx status code -func (o *DeleteNodePoolForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this delete node pool forbidden response a status code equal to that given -func (o *DeleteNodePoolForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the delete node pool forbidden response -func (o *DeleteNodePoolForbidden) Code() int { - return 403 -} - -func (o *DeleteNodePoolForbidden) Error() string { - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}][%d] deleteNodePoolForbidden", 403) -} - -func (o *DeleteNodePoolForbidden) String() string { - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}][%d] deleteNodePoolForbidden", 403) -} - -func (o *DeleteNodePoolForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewDeleteNodePoolNotFound creates a DeleteNodePoolNotFound with default headers values -func NewDeleteNodePoolNotFound() *DeleteNodePoolNotFound { - return &DeleteNodePoolNotFound{} -} - -/* -DeleteNodePoolNotFound describes a response with status code 404, with default header values. - -Node pool not found -*/ -type DeleteNodePoolNotFound struct { -} - -// IsSuccess returns true when this delete node pool not found response has a 2xx status code -func (o *DeleteNodePoolNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this delete node pool not found response has a 3xx status code -func (o *DeleteNodePoolNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete node pool not found response has a 4xx status code -func (o *DeleteNodePoolNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this delete node pool not found response has a 5xx status code -func (o *DeleteNodePoolNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this delete node pool not found response a status code equal to that given -func (o *DeleteNodePoolNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the delete node pool not found response -func (o *DeleteNodePoolNotFound) Code() int { - return 404 -} - -func (o *DeleteNodePoolNotFound) Error() string { - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}][%d] deleteNodePoolNotFound", 404) -} - -func (o *DeleteNodePoolNotFound) String() string { - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}][%d] deleteNodePoolNotFound", 404) -} - -func (o *DeleteNodePoolNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewDeleteNodePoolInternalServerError creates a DeleteNodePoolInternalServerError with default headers values -func NewDeleteNodePoolInternalServerError() *DeleteNodePoolInternalServerError { - return &DeleteNodePoolInternalServerError{} -} - -/* -DeleteNodePoolInternalServerError describes a response with status code 500, with default header values. - -Unexpected error -*/ -type DeleteNodePoolInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this delete node pool internal server error response has a 2xx status code -func (o *DeleteNodePoolInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this delete node pool internal server error response has a 3xx status code -func (o *DeleteNodePoolInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete node pool internal server error response has a 4xx status code -func (o *DeleteNodePoolInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this delete node pool internal server error response has a 5xx status code -func (o *DeleteNodePoolInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this delete node pool internal server error response a status code equal to that given -func (o *DeleteNodePoolInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the delete node pool internal server error response -func (o *DeleteNodePoolInternalServerError) Code() int { - return 500 -} - -func (o *DeleteNodePoolInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}][%d] deleteNodePoolInternalServerError %s", 500, payload) -} - -func (o *DeleteNodePoolInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[DELETE /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}][%d] deleteNodePoolInternalServerError %s", 500, payload) -} - -func (o *DeleteNodePoolInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *DeleteNodePoolInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/cluster-registry/client/node_pools/list_node_pools_parameters.go b/pkg/cluster-registry/client/node_pools/list_node_pools_parameters.go deleted file mode 100644 index 3e9eca17..00000000 --- a/pkg/cluster-registry/client/node_pools/list_node_pools_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package node_pools - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewListNodePoolsParams creates a new ListNodePoolsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListNodePoolsParams() *ListNodePoolsParams { - return &ListNodePoolsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListNodePoolsParamsWithTimeout creates a new ListNodePoolsParams object -// with the ability to set a timeout on a request. -func NewListNodePoolsParamsWithTimeout(timeout time.Duration) *ListNodePoolsParams { - return &ListNodePoolsParams{ - timeout: timeout, - } -} - -// NewListNodePoolsParamsWithContext creates a new ListNodePoolsParams object -// with the ability to set a context for a request. -func NewListNodePoolsParamsWithContext(ctx context.Context) *ListNodePoolsParams { - return &ListNodePoolsParams{ - Context: ctx, - } -} - -// NewListNodePoolsParamsWithHTTPClient creates a new ListNodePoolsParams object -// with the ability to set a custom HTTPClient for a request. -func NewListNodePoolsParamsWithHTTPClient(client *http.Client) *ListNodePoolsParams { - return &ListNodePoolsParams{ - HTTPClient: client, - } -} - -/* -ListNodePoolsParams contains all the parameters to send to the API endpoint - - for the list node pools operation. - - Typically these are written to a http.Request. -*/ -type ListNodePoolsParams struct { - - /* ClusterID. - - ID of the cluster. - */ - ClusterID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list node pools params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListNodePoolsParams) WithDefaults() *ListNodePoolsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list node pools params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListNodePoolsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list node pools params -func (o *ListNodePoolsParams) WithTimeout(timeout time.Duration) *ListNodePoolsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list node pools params -func (o *ListNodePoolsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list node pools params -func (o *ListNodePoolsParams) WithContext(ctx context.Context) *ListNodePoolsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list node pools params -func (o *ListNodePoolsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list node pools params -func (o *ListNodePoolsParams) WithHTTPClient(client *http.Client) *ListNodePoolsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list node pools params -func (o *ListNodePoolsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithClusterID adds the clusterID to the list node pools params -func (o *ListNodePoolsParams) WithClusterID(clusterID string) *ListNodePoolsParams { - o.SetClusterID(clusterID) - return o -} - -// SetClusterID adds the clusterId to the list node pools params -func (o *ListNodePoolsParams) SetClusterID(clusterID string) { - o.ClusterID = clusterID -} - -// WriteToRequest writes these params to a swagger request -func (o *ListNodePoolsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cluster_id - if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/cluster-registry/client/node_pools/list_node_pools_responses.go b/pkg/cluster-registry/client/node_pools/list_node_pools_responses.go deleted file mode 100644 index 33c50fd2..00000000 --- a/pkg/cluster-registry/client/node_pools/list_node_pools_responses.go +++ /dev/null @@ -1,417 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package node_pools - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - "fmt" - "io" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/models" -) - -// ListNodePoolsReader is a Reader for the ListNodePools structure. -type ListNodePoolsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListNodePoolsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListNodePoolsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewListNodePoolsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewListNodePoolsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewListNodePoolsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /kubernetes-clusters/{cluster_id}/node-pools] listNodePools", response, response.Code()) - } -} - -// NewListNodePoolsOK creates a ListNodePoolsOK with default headers values -func NewListNodePoolsOK() *ListNodePoolsOK { - return &ListNodePoolsOK{} -} - -/* -ListNodePoolsOK describes a response with status code 200, with default header values. - -List of node pools -*/ -type ListNodePoolsOK struct { - Payload *ListNodePoolsOKBody -} - -// IsSuccess returns true when this list node pools o k response has a 2xx status code -func (o *ListNodePoolsOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this list node pools o k response has a 3xx status code -func (o *ListNodePoolsOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list node pools o k response has a 4xx status code -func (o *ListNodePoolsOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this list node pools o k response has a 5xx status code -func (o *ListNodePoolsOK) IsServerError() bool { - return false -} - -// IsCode returns true when this list node pools o k response a status code equal to that given -func (o *ListNodePoolsOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the list node pools o k response -func (o *ListNodePoolsOK) Code() int { - return 200 -} - -func (o *ListNodePoolsOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /kubernetes-clusters/{cluster_id}/node-pools][%d] listNodePoolsOK %s", 200, payload) -} - -func (o *ListNodePoolsOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /kubernetes-clusters/{cluster_id}/node-pools][%d] listNodePoolsOK %s", 200, payload) -} - -func (o *ListNodePoolsOK) GetPayload() *ListNodePoolsOKBody { - return o.Payload -} - -func (o *ListNodePoolsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(ListNodePoolsOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListNodePoolsUnauthorized creates a ListNodePoolsUnauthorized with default headers values -func NewListNodePoolsUnauthorized() *ListNodePoolsUnauthorized { - return &ListNodePoolsUnauthorized{} -} - -/* -ListNodePoolsUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type ListNodePoolsUnauthorized struct { -} - -// IsSuccess returns true when this list node pools unauthorized response has a 2xx status code -func (o *ListNodePoolsUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this list node pools unauthorized response has a 3xx status code -func (o *ListNodePoolsUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list node pools unauthorized response has a 4xx status code -func (o *ListNodePoolsUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this list node pools unauthorized response has a 5xx status code -func (o *ListNodePoolsUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this list node pools unauthorized response a status code equal to that given -func (o *ListNodePoolsUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the list node pools unauthorized response -func (o *ListNodePoolsUnauthorized) Code() int { - return 401 -} - -func (o *ListNodePoolsUnauthorized) Error() string { - return fmt.Sprintf("[GET /kubernetes-clusters/{cluster_id}/node-pools][%d] listNodePoolsUnauthorized", 401) -} - -func (o *ListNodePoolsUnauthorized) String() string { - return fmt.Sprintf("[GET /kubernetes-clusters/{cluster_id}/node-pools][%d] listNodePoolsUnauthorized", 401) -} - -func (o *ListNodePoolsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewListNodePoolsForbidden creates a ListNodePoolsForbidden with default headers values -func NewListNodePoolsForbidden() *ListNodePoolsForbidden { - return &ListNodePoolsForbidden{} -} - -/* -ListNodePoolsForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ListNodePoolsForbidden struct { -} - -// IsSuccess returns true when this list node pools forbidden response has a 2xx status code -func (o *ListNodePoolsForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this list node pools forbidden response has a 3xx status code -func (o *ListNodePoolsForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list node pools forbidden response has a 4xx status code -func (o *ListNodePoolsForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this list node pools forbidden response has a 5xx status code -func (o *ListNodePoolsForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this list node pools forbidden response a status code equal to that given -func (o *ListNodePoolsForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the list node pools forbidden response -func (o *ListNodePoolsForbidden) Code() int { - return 403 -} - -func (o *ListNodePoolsForbidden) Error() string { - return fmt.Sprintf("[GET /kubernetes-clusters/{cluster_id}/node-pools][%d] listNodePoolsForbidden", 403) -} - -func (o *ListNodePoolsForbidden) String() string { - return fmt.Sprintf("[GET /kubernetes-clusters/{cluster_id}/node-pools][%d] listNodePoolsForbidden", 403) -} - -func (o *ListNodePoolsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewListNodePoolsInternalServerError creates a ListNodePoolsInternalServerError with default headers values -func NewListNodePoolsInternalServerError() *ListNodePoolsInternalServerError { - return &ListNodePoolsInternalServerError{} -} - -/* -ListNodePoolsInternalServerError describes a response with status code 500, with default header values. - -Unexpected error -*/ -type ListNodePoolsInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this list node pools internal server error response has a 2xx status code -func (o *ListNodePoolsInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this list node pools internal server error response has a 3xx status code -func (o *ListNodePoolsInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list node pools internal server error response has a 4xx status code -func (o *ListNodePoolsInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this list node pools internal server error response has a 5xx status code -func (o *ListNodePoolsInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this list node pools internal server error response a status code equal to that given -func (o *ListNodePoolsInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the list node pools internal server error response -func (o *ListNodePoolsInternalServerError) Code() int { - return 500 -} - -func (o *ListNodePoolsInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /kubernetes-clusters/{cluster_id}/node-pools][%d] listNodePoolsInternalServerError %s", 500, payload) -} - -func (o *ListNodePoolsInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /kubernetes-clusters/{cluster_id}/node-pools][%d] listNodePoolsInternalServerError %s", 500, payload) -} - -func (o *ListNodePoolsInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *ListNodePoolsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -ListNodePoolsOKBody list node pools o k body -swagger:model ListNodePoolsOKBody -*/ -type ListNodePoolsOKBody struct { - - // items - Items []*models.NodePool `json:"items"` -} - -// Validate validates this list node pools o k body -func (o *ListNodePoolsOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateItems(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListNodePoolsOKBody) validateItems(formats strfmt.Registry) error { - if swag.IsZero(o.Items) { // not required - return nil - } - - for i := 0; i < len(o.Items); i++ { - if swag.IsZero(o.Items[i]) { // not required - continue - } - - if o.Items[i] != nil { - if err := o.Items[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("listNodePoolsOK" + "." + "items" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("listNodePoolsOK" + "." + "items" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list node pools o k body based on the context it is used -func (o *ListNodePoolsOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateItems(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListNodePoolsOKBody) contextValidateItems(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(o.Items); i++ { - - if o.Items[i] != nil { - - if swag.IsZero(o.Items[i]) { // not required - return nil - } - - if err := o.Items[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("listNodePoolsOK" + "." + "items" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("listNodePoolsOK" + "." + "items" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListNodePoolsOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListNodePoolsOKBody) UnmarshalBinary(b []byte) error { - var res ListNodePoolsOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/pkg/cluster-registry/client/node_pools/node_pools_client.go b/pkg/cluster-registry/client/node_pools/node_pools_client.go deleted file mode 100644 index 8c5cdb79..00000000 --- a/pkg/cluster-registry/client/node_pools/node_pools_client.go +++ /dev/null @@ -1,237 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package node_pools - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// New creates a new node pools API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new node pools API client with basic auth credentials. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - user: user for basic authentication header. -// - password: password for basic authentication header. -func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BasicAuth(user, password) - return &Client{transport: transport, formats: strfmt.Default} -} - -// New creates a new node pools API client with a bearer token for authentication. -// It takes the following parameters: -// - host: http host (github.com). -// - basePath: any base path for the API client ("/v1", "/v3"). -// - scheme: http scheme ("http", "https"). -// - bearerToken: bearer token for Bearer authentication header. -func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { - transport := httptransport.New(host, basePath, []string{scheme}) - transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) - return &Client{transport: transport, formats: strfmt.Default} -} - -/* -Client for node pools API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption may be used to customize the behavior of Client methods. -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreateOrUpdateNodePool(params *CreateOrUpdateNodePoolParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateOrUpdateNodePoolOK, error) - - DeleteNodePool(params *DeleteNodePoolParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteNodePoolNoContent, error) - - ListNodePools(params *ListNodePoolsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListNodePoolsOK, error) - - UpdateNodePool(params *UpdateNodePoolParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateNodePoolOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -CreateOrUpdateNodePool creates update node pool - -Create/update a node pool. -*/ -func (a *Client) CreateOrUpdateNodePool(params *CreateOrUpdateNodePoolParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateOrUpdateNodePoolOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateOrUpdateNodePoolParams() - } - op := &runtime.ClientOperation{ - ID: "createOrUpdateNodePool", - Method: "PUT", - PathPattern: "/kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &CreateOrUpdateNodePoolReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateOrUpdateNodePoolOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createOrUpdateNodePool: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -DeleteNodePool deletes node pool - -Deletes node pool. -*/ -func (a *Client) DeleteNodePool(params *DeleteNodePoolParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteNodePoolNoContent, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteNodePoolParams() - } - op := &runtime.ClientOperation{ - ID: "deleteNodePool", - Method: "DELETE", - PathPattern: "/kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DeleteNodePoolReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteNodePoolNoContent) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteNodePool: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -ListNodePools lists node pools - -List all node pools of a cluster. -*/ -func (a *Client) ListNodePools(params *ListNodePoolsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListNodePoolsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListNodePoolsParams() - } - op := &runtime.ClientOperation{ - ID: "listNodePools", - Method: "GET", - PathPattern: "/kubernetes-clusters/{cluster_id}/node-pools", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListNodePoolsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListNodePoolsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listNodePools: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -UpdateNodePool updates node pool - -Update a node pool. -*/ -func (a *Client) UpdateNodePool(params *UpdateNodePoolParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateNodePoolOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateNodePoolParams() - } - op := &runtime.ClientOperation{ - ID: "updateNodePool", - Method: "PATCH", - PathPattern: "/kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &UpdateNodePoolReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateNodePoolOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateNodePool: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/pkg/cluster-registry/client/node_pools/update_node_pool_parameters.go b/pkg/cluster-registry/client/node_pools/update_node_pool_parameters.go deleted file mode 100644 index e3d32638..00000000 --- a/pkg/cluster-registry/client/node_pools/update_node_pool_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package node_pools - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/models" -) - -// NewUpdateNodePoolParams creates a new UpdateNodePoolParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateNodePoolParams() *UpdateNodePoolParams { - return &UpdateNodePoolParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateNodePoolParamsWithTimeout creates a new UpdateNodePoolParams object -// with the ability to set a timeout on a request. -func NewUpdateNodePoolParamsWithTimeout(timeout time.Duration) *UpdateNodePoolParams { - return &UpdateNodePoolParams{ - timeout: timeout, - } -} - -// NewUpdateNodePoolParamsWithContext creates a new UpdateNodePoolParams object -// with the ability to set a context for a request. -func NewUpdateNodePoolParamsWithContext(ctx context.Context) *UpdateNodePoolParams { - return &UpdateNodePoolParams{ - Context: ctx, - } -} - -// NewUpdateNodePoolParamsWithHTTPClient creates a new UpdateNodePoolParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateNodePoolParamsWithHTTPClient(client *http.Client) *UpdateNodePoolParams { - return &UpdateNodePoolParams{ - HTTPClient: client, - } -} - -/* -UpdateNodePoolParams contains all the parameters to send to the API endpoint - - for the update node pool operation. - - Typically these are written to a http.Request. -*/ -type UpdateNodePoolParams struct { - - /* ClusterID. - - ID of the cluster. - */ - ClusterID string - - /* NodePool. - - Node pool to be updated. - */ - NodePool *models.NodePoolUpdate - - /* NodePoolName. - - Name of the node pool. - */ - NodePoolName string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update node pool params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateNodePoolParams) WithDefaults() *UpdateNodePoolParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update node pool params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateNodePoolParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update node pool params -func (o *UpdateNodePoolParams) WithTimeout(timeout time.Duration) *UpdateNodePoolParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update node pool params -func (o *UpdateNodePoolParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update node pool params -func (o *UpdateNodePoolParams) WithContext(ctx context.Context) *UpdateNodePoolParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update node pool params -func (o *UpdateNodePoolParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update node pool params -func (o *UpdateNodePoolParams) WithHTTPClient(client *http.Client) *UpdateNodePoolParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update node pool params -func (o *UpdateNodePoolParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithClusterID adds the clusterID to the update node pool params -func (o *UpdateNodePoolParams) WithClusterID(clusterID string) *UpdateNodePoolParams { - o.SetClusterID(clusterID) - return o -} - -// SetClusterID adds the clusterId to the update node pool params -func (o *UpdateNodePoolParams) SetClusterID(clusterID string) { - o.ClusterID = clusterID -} - -// WithNodePool adds the nodePool to the update node pool params -func (o *UpdateNodePoolParams) WithNodePool(nodePool *models.NodePoolUpdate) *UpdateNodePoolParams { - o.SetNodePool(nodePool) - return o -} - -// SetNodePool adds the nodePool to the update node pool params -func (o *UpdateNodePoolParams) SetNodePool(nodePool *models.NodePoolUpdate) { - o.NodePool = nodePool -} - -// WithNodePoolName adds the nodePoolName to the update node pool params -func (o *UpdateNodePoolParams) WithNodePoolName(nodePoolName string) *UpdateNodePoolParams { - o.SetNodePoolName(nodePoolName) - return o -} - -// SetNodePoolName adds the nodePoolName to the update node pool params -func (o *UpdateNodePoolParams) SetNodePoolName(nodePoolName string) { - o.NodePoolName = nodePoolName -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateNodePoolParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cluster_id - if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { - return err - } - if o.NodePool != nil { - if err := r.SetBodyParam(o.NodePool); err != nil { - return err - } - } - - // path param node_pool_name - if err := r.SetPathParam("node_pool_name", o.NodePoolName); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/cluster-registry/client/node_pools/update_node_pool_responses.go b/pkg/cluster-registry/client/node_pools/update_node_pool_responses.go deleted file mode 100644 index 1db6a230..00000000 --- a/pkg/cluster-registry/client/node_pools/update_node_pool_responses.go +++ /dev/null @@ -1,382 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package node_pools - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/models" -) - -// UpdateNodePoolReader is a Reader for the UpdateNodePool structure. -type UpdateNodePoolReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateNodePoolReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateNodePoolOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateNodePoolBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateNodePoolUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewUpdateNodePoolForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewUpdateNodePoolInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PATCH /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}] updateNodePool", response, response.Code()) - } -} - -// NewUpdateNodePoolOK creates a UpdateNodePoolOK with default headers values -func NewUpdateNodePoolOK() *UpdateNodePoolOK { - return &UpdateNodePoolOK{} -} - -/* -UpdateNodePoolOK describes a response with status code 200, with default header values. - -The node pool update request is accepted. -*/ -type UpdateNodePoolOK struct { - Payload *models.NodePool -} - -// IsSuccess returns true when this update node pool o k response has a 2xx status code -func (o *UpdateNodePoolOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this update node pool o k response has a 3xx status code -func (o *UpdateNodePoolOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update node pool o k response has a 4xx status code -func (o *UpdateNodePoolOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this update node pool o k response has a 5xx status code -func (o *UpdateNodePoolOK) IsServerError() bool { - return false -} - -// IsCode returns true when this update node pool o k response a status code equal to that given -func (o *UpdateNodePoolOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the update node pool o k response -func (o *UpdateNodePoolOK) Code() int { - return 200 -} - -func (o *UpdateNodePoolOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PATCH /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}][%d] updateNodePoolOK %s", 200, payload) -} - -func (o *UpdateNodePoolOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PATCH /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}][%d] updateNodePoolOK %s", 200, payload) -} - -func (o *UpdateNodePoolOK) GetPayload() *models.NodePool { - return o.Payload -} - -func (o *UpdateNodePoolOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.NodePool) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateNodePoolBadRequest creates a UpdateNodePoolBadRequest with default headers values -func NewUpdateNodePoolBadRequest() *UpdateNodePoolBadRequest { - return &UpdateNodePoolBadRequest{} -} - -/* -UpdateNodePoolBadRequest describes a response with status code 400, with default header values. - -Invalid request -*/ -type UpdateNodePoolBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this update node pool bad request response has a 2xx status code -func (o *UpdateNodePoolBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update node pool bad request response has a 3xx status code -func (o *UpdateNodePoolBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update node pool bad request response has a 4xx status code -func (o *UpdateNodePoolBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this update node pool bad request response has a 5xx status code -func (o *UpdateNodePoolBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this update node pool bad request response a status code equal to that given -func (o *UpdateNodePoolBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the update node pool bad request response -func (o *UpdateNodePoolBadRequest) Code() int { - return 400 -} - -func (o *UpdateNodePoolBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PATCH /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}][%d] updateNodePoolBadRequest %s", 400, payload) -} - -func (o *UpdateNodePoolBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PATCH /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}][%d] updateNodePoolBadRequest %s", 400, payload) -} - -func (o *UpdateNodePoolBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateNodePoolBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateNodePoolUnauthorized creates a UpdateNodePoolUnauthorized with default headers values -func NewUpdateNodePoolUnauthorized() *UpdateNodePoolUnauthorized { - return &UpdateNodePoolUnauthorized{} -} - -/* -UpdateNodePoolUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type UpdateNodePoolUnauthorized struct { -} - -// IsSuccess returns true when this update node pool unauthorized response has a 2xx status code -func (o *UpdateNodePoolUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update node pool unauthorized response has a 3xx status code -func (o *UpdateNodePoolUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update node pool unauthorized response has a 4xx status code -func (o *UpdateNodePoolUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this update node pool unauthorized response has a 5xx status code -func (o *UpdateNodePoolUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this update node pool unauthorized response a status code equal to that given -func (o *UpdateNodePoolUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the update node pool unauthorized response -func (o *UpdateNodePoolUnauthorized) Code() int { - return 401 -} - -func (o *UpdateNodePoolUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}][%d] updateNodePoolUnauthorized", 401) -} - -func (o *UpdateNodePoolUnauthorized) String() string { - return fmt.Sprintf("[PATCH /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}][%d] updateNodePoolUnauthorized", 401) -} - -func (o *UpdateNodePoolUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewUpdateNodePoolForbidden creates a UpdateNodePoolForbidden with default headers values -func NewUpdateNodePoolForbidden() *UpdateNodePoolForbidden { - return &UpdateNodePoolForbidden{} -} - -/* -UpdateNodePoolForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type UpdateNodePoolForbidden struct { -} - -// IsSuccess returns true when this update node pool forbidden response has a 2xx status code -func (o *UpdateNodePoolForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update node pool forbidden response has a 3xx status code -func (o *UpdateNodePoolForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update node pool forbidden response has a 4xx status code -func (o *UpdateNodePoolForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this update node pool forbidden response has a 5xx status code -func (o *UpdateNodePoolForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this update node pool forbidden response a status code equal to that given -func (o *UpdateNodePoolForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the update node pool forbidden response -func (o *UpdateNodePoolForbidden) Code() int { - return 403 -} - -func (o *UpdateNodePoolForbidden) Error() string { - return fmt.Sprintf("[PATCH /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}][%d] updateNodePoolForbidden", 403) -} - -func (o *UpdateNodePoolForbidden) String() string { - return fmt.Sprintf("[PATCH /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}][%d] updateNodePoolForbidden", 403) -} - -func (o *UpdateNodePoolForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewUpdateNodePoolInternalServerError creates a UpdateNodePoolInternalServerError with default headers values -func NewUpdateNodePoolInternalServerError() *UpdateNodePoolInternalServerError { - return &UpdateNodePoolInternalServerError{} -} - -/* -UpdateNodePoolInternalServerError describes a response with status code 500, with default header values. - -Unexpected error -*/ -type UpdateNodePoolInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this update node pool internal server error response has a 2xx status code -func (o *UpdateNodePoolInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update node pool internal server error response has a 3xx status code -func (o *UpdateNodePoolInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update node pool internal server error response has a 4xx status code -func (o *UpdateNodePoolInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this update node pool internal server error response has a 5xx status code -func (o *UpdateNodePoolInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this update node pool internal server error response a status code equal to that given -func (o *UpdateNodePoolInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the update node pool internal server error response -func (o *UpdateNodePoolInternalServerError) Code() int { - return 500 -} - -func (o *UpdateNodePoolInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PATCH /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}][%d] updateNodePoolInternalServerError %s", 500, payload) -} - -func (o *UpdateNodePoolInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[PATCH /kubernetes-clusters/{cluster_id}/node-pools/{node_pool_name}][%d] updateNodePoolInternalServerError %s", 500, payload) -} - -func (o *UpdateNodePoolInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *UpdateNodePoolInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/cluster-registry/models/cluster.go b/pkg/cluster-registry/models/cluster.go deleted file mode 100644 index e462a5f9..00000000 --- a/pkg/cluster-registry/models/cluster.go +++ /dev/null @@ -1,430 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Cluster cluster -// -// swagger:model Cluster -type Cluster struct { - - // Human readable alias for the Kubernetes cluster. The alias is unique - // but can be changed. - // - // Example: production-cluster - // Required: true - // Pattern: ^[a-z][a-z0-9-]*[a-z0-9]$ - Alias *string `json:"alias"` - - // URL of the Kubernetes API server endpoint - // Example: https://kube-1.foo.example.org/ - // Required: true - APIServerURL *string `json:"api_server_url"` - - // A version channel for the cluster. - // Example: alpha - // Required: true - Channel *string `json:"channel"` - - // Configuration items unique to the cluster. E.g. custom API key used - // by one of the cluster services. - // - // Example: {"product_x_key":"abcde","product_y_key":"12345"} - ConfigItems map[string]string `json:"config_items,omitempty"` - - // Level of criticality as defined by tech controlling. 1 is non critical, 2 is standard production, 3 is PCI. - // Example: 2 - // Required: true - CriticalityLevel *int32 `json:"criticality_level"` - - // The environment in which the cluster run. - // - // Example: production - // Required: true - Environment *string `json:"environment"` - - // Globally unique ID of the Kubernetes cluster - // Example: aws:123456789012:eu-central-1:kube-1 - // Required: true - ID *string `json:"id"` - - // The identifier of the infrastructure account in which the cluster will live in - // Example: aws:123456789012 - // Required: true - InfrastructureAccount *string `json:"infrastructure_account"` - - // Status of the cluster. - // Example: ready - // Required: true - // Enum: ["requested","creating","ready","decommission-requested","decommissioned"] - LifecycleStatus *string `json:"lifecycle_status"` - - // Cluster identifier which is local to the region - // Example: kube-1 - // Required: true - LocalID *string `json:"local_id"` - - // node pools - NodePools []*NodePool `json:"node_pools"` - - // The provider of the cluster. Possible values are "zalando-aws", "GKE", ... - // Example: zalando-aws - // Required: true - Provider *string `json:"provider"` - - // The region of the cluster - // Example: eu-central-1 - // Required: true - Region *string `json:"region"` - - // status - Status *ClusterStatus `json:"status,omitempty"` -} - -// Validate validates this cluster -func (m *Cluster) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAlias(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAPIServerURL(formats); err != nil { - res = append(res, err) - } - - if err := m.validateChannel(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCriticalityLevel(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEnvironment(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateInfrastructureAccount(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLifecycleStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLocalID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNodePools(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProvider(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRegion(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Cluster) validateAlias(formats strfmt.Registry) error { - - if err := validate.Required("alias", "body", m.Alias); err != nil { - return err - } - - if err := validate.Pattern("alias", "body", *m.Alias, `^[a-z][a-z0-9-]*[a-z0-9]$`); err != nil { - return err - } - - return nil -} - -func (m *Cluster) validateAPIServerURL(formats strfmt.Registry) error { - - if err := validate.Required("api_server_url", "body", m.APIServerURL); err != nil { - return err - } - - return nil -} - -func (m *Cluster) validateChannel(formats strfmt.Registry) error { - - if err := validate.Required("channel", "body", m.Channel); err != nil { - return err - } - - return nil -} - -func (m *Cluster) validateCriticalityLevel(formats strfmt.Registry) error { - - if err := validate.Required("criticality_level", "body", m.CriticalityLevel); err != nil { - return err - } - - return nil -} - -func (m *Cluster) validateEnvironment(formats strfmt.Registry) error { - - if err := validate.Required("environment", "body", m.Environment); err != nil { - return err - } - - return nil -} - -func (m *Cluster) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *Cluster) validateInfrastructureAccount(formats strfmt.Registry) error { - - if err := validate.Required("infrastructure_account", "body", m.InfrastructureAccount); err != nil { - return err - } - - return nil -} - -var clusterTypeLifecycleStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["requested","creating","ready","decommission-requested","decommissioned"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - clusterTypeLifecycleStatusPropEnum = append(clusterTypeLifecycleStatusPropEnum, v) - } -} - -const ( - - // ClusterLifecycleStatusRequested captures enum value "requested" - ClusterLifecycleStatusRequested string = "requested" - - // ClusterLifecycleStatusCreating captures enum value "creating" - ClusterLifecycleStatusCreating string = "creating" - - // ClusterLifecycleStatusReady captures enum value "ready" - ClusterLifecycleStatusReady string = "ready" - - // ClusterLifecycleStatusDecommissionDashRequested captures enum value "decommission-requested" - ClusterLifecycleStatusDecommissionDashRequested string = "decommission-requested" - - // ClusterLifecycleStatusDecommissioned captures enum value "decommissioned" - ClusterLifecycleStatusDecommissioned string = "decommissioned" -) - -// prop value enum -func (m *Cluster) validateLifecycleStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, clusterTypeLifecycleStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *Cluster) validateLifecycleStatus(formats strfmt.Registry) error { - - if err := validate.Required("lifecycle_status", "body", m.LifecycleStatus); err != nil { - return err - } - - // value enum - if err := m.validateLifecycleStatusEnum("lifecycle_status", "body", *m.LifecycleStatus); err != nil { - return err - } - - return nil -} - -func (m *Cluster) validateLocalID(formats strfmt.Registry) error { - - if err := validate.Required("local_id", "body", m.LocalID); err != nil { - return err - } - - return nil -} - -func (m *Cluster) validateNodePools(formats strfmt.Registry) error { - if swag.IsZero(m.NodePools) { // not required - return nil - } - - for i := 0; i < len(m.NodePools); i++ { - if swag.IsZero(m.NodePools[i]) { // not required - continue - } - - if m.NodePools[i] != nil { - if err := m.NodePools[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("node_pools" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("node_pools" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *Cluster) validateProvider(formats strfmt.Registry) error { - - if err := validate.Required("provider", "body", m.Provider); err != nil { - return err - } - - return nil -} - -func (m *Cluster) validateRegion(formats strfmt.Registry) error { - - if err := validate.Required("region", "body", m.Region); err != nil { - return err - } - - return nil -} - -func (m *Cluster) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required - return nil - } - - if m.Status != nil { - if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - } - - return nil -} - -// ContextValidate validate this cluster based on the context it is used -func (m *Cluster) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateNodePools(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Cluster) contextValidateNodePools(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.NodePools); i++ { - - if m.NodePools[i] != nil { - - if swag.IsZero(m.NodePools[i]) { // not required - return nil - } - - if err := m.NodePools[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("node_pools" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("node_pools" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *Cluster) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if m.Status != nil { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Cluster) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Cluster) UnmarshalBinary(b []byte) error { - var res Cluster - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/cluster-registry/models/cluster_status.go b/pkg/cluster-registry/models/cluster_status.go deleted file mode 100644 index 8df1ce22..00000000 --- a/pkg/cluster-registry/models/cluster_status.go +++ /dev/null @@ -1,378 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ClusterStatus cluster status -// -// swagger:model ClusterStatus -type ClusterStatus struct { - - // Current version of the cluster. This can refer to a commit hash or - // any valid version string in the context. - // - // Example: a1b2c3d4e5f6 - CurrentVersion string `json:"current_version,omitempty"` - - // Last working version of the cluster. This can refer to a commit - // hash or any valid version string in the context. In case any - // problems are defined for the current_version then it should be - // safe to roll back to this last version. - // - // Example: a2b3c4d5e6f7 - LastVersion string `json:"last_version,omitempty"` - - // Next version of the cluster. This field indicates that the cluster is - // being updated to a new version. This can refer to a commit hash or any - // valid version string in the context. - // - // Example: a3b4c5d6e7f8 - NextVersion string `json:"next_version,omitempty"` - - // problems - Problems []*ClusterStatusProblemsItems0 `json:"problems"` -} - -// Validate validates this cluster status -func (m *ClusterStatus) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateProblems(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ClusterStatus) validateProblems(formats strfmt.Registry) error { - if swag.IsZero(m.Problems) { // not required - return nil - } - - for i := 0; i < len(m.Problems); i++ { - if swag.IsZero(m.Problems[i]) { // not required - continue - } - - if m.Problems[i] != nil { - if err := m.Problems[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("problems" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("problems" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this cluster status based on the context it is used -func (m *ClusterStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateProblems(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ClusterStatus) contextValidateProblems(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Problems); i++ { - - if m.Problems[i] != nil { - - if swag.IsZero(m.Problems[i]) { // not required - return nil - } - - if err := m.Problems[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("problems" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("problems" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ClusterStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ClusterStatus) UnmarshalBinary(b []byte) error { - var res ClusterStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} - -// ClusterStatusProblemsItems0 cluster status problems items0 -// -// swagger:model ClusterStatusProblemsItems0 -type ClusterStatusProblemsItems0 struct { - - // A human-readable explanation specific to this occurrence of - // the problem. - // - // Example: Cluster lifecycle manager was unable to apply the\nkubernetes-dashboard service because of insufficient\npermissions.\n - Detail string `json:"detail,omitempty"` - - // A URI reference that identifies the specific occurrence of - // the problem. - // - // Example: service/kubernetes-dashboard - Instance string `json:"instance,omitempty"` - - // The HTTP status code generated by the origin server for this - // occurence of the problem. - // - // Example: 401 - Status int32 `json:"status,omitempty"` - - // A short, human-readable summary of the problem type. - // - // Example: Failed to apply service 'kubernetes-dashboard' - // Required: true - Title *string `json:"title"` - - // A URI reference the indentifies the problem type. - // Example: https://cluster-status.example.org/service-apply-failed - // Required: true - Type *string `json:"type"` - - // cluster status problems items0 - ClusterStatusProblemsItems0 map[string]string `json:"-"` -} - -// UnmarshalJSON unmarshals this object with additional properties from JSON -func (m *ClusterStatusProblemsItems0) UnmarshalJSON(data []byte) error { - // stage 1, bind the properties - var stage1 struct { - - // A human-readable explanation specific to this occurrence of - // the problem. - // - // Example: Cluster lifecycle manager was unable to apply the\nkubernetes-dashboard service because of insufficient\npermissions.\n - Detail string `json:"detail,omitempty"` - - // A URI reference that identifies the specific occurrence of - // the problem. - // - // Example: service/kubernetes-dashboard - Instance string `json:"instance,omitempty"` - - // The HTTP status code generated by the origin server for this - // occurence of the problem. - // - // Example: 401 - Status int32 `json:"status,omitempty"` - - // A short, human-readable summary of the problem type. - // - // Example: Failed to apply service 'kubernetes-dashboard' - // Required: true - Title *string `json:"title"` - - // A URI reference the indentifies the problem type. - // Example: https://cluster-status.example.org/service-apply-failed - // Required: true - Type *string `json:"type"` - } - if err := json.Unmarshal(data, &stage1); err != nil { - return err - } - var rcv ClusterStatusProblemsItems0 - - rcv.Detail = stage1.Detail - rcv.Instance = stage1.Instance - rcv.Status = stage1.Status - rcv.Title = stage1.Title - rcv.Type = stage1.Type - *m = rcv - - // stage 2, remove properties and add to map - stage2 := make(map[string]json.RawMessage) - if err := json.Unmarshal(data, &stage2); err != nil { - return err - } - - delete(stage2, "detail") - delete(stage2, "instance") - delete(stage2, "status") - delete(stage2, "title") - delete(stage2, "type") - // stage 3, add additional properties values - if len(stage2) > 0 { - result := make(map[string]string) - for k, v := range stage2 { - var toadd string - if err := json.Unmarshal(v, &toadd); err != nil { - return err - } - result[k] = toadd - } - m.ClusterStatusProblemsItems0 = result - } - - return nil -} - -// MarshalJSON marshals this object with additional properties into a JSON object -func (m ClusterStatusProblemsItems0) MarshalJSON() ([]byte, error) { - var stage1 struct { - - // A human-readable explanation specific to this occurrence of - // the problem. - // - // Example: Cluster lifecycle manager was unable to apply the\nkubernetes-dashboard service because of insufficient\npermissions.\n - Detail string `json:"detail,omitempty"` - - // A URI reference that identifies the specific occurrence of - // the problem. - // - // Example: service/kubernetes-dashboard - Instance string `json:"instance,omitempty"` - - // The HTTP status code generated by the origin server for this - // occurence of the problem. - // - // Example: 401 - Status int32 `json:"status,omitempty"` - - // A short, human-readable summary of the problem type. - // - // Example: Failed to apply service 'kubernetes-dashboard' - // Required: true - Title *string `json:"title"` - - // A URI reference the indentifies the problem type. - // Example: https://cluster-status.example.org/service-apply-failed - // Required: true - Type *string `json:"type"` - } - - stage1.Detail = m.Detail - stage1.Instance = m.Instance - stage1.Status = m.Status - stage1.Title = m.Title - stage1.Type = m.Type - - // make JSON object for known properties - props, err := json.Marshal(stage1) - if err != nil { - return nil, err - } - - if len(m.ClusterStatusProblemsItems0) == 0 { // no additional properties - return props, nil - } - - // make JSON object for the additional properties - additional, err := json.Marshal(m.ClusterStatusProblemsItems0) - if err != nil { - return nil, err - } - - if len(props) < 3 { // "{}": only additional properties - return additional, nil - } - - // concatenate the 2 objects - return swag.ConcatJSON(props, additional), nil -} - -// Validate validates this cluster status problems items0 -func (m *ClusterStatusProblemsItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateTitle(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ClusterStatusProblemsItems0) validateTitle(formats strfmt.Registry) error { - - if err := validate.Required("title", "body", m.Title); err != nil { - return err - } - - return nil -} - -func (m *ClusterStatusProblemsItems0) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this cluster status problems items0 based on context it is used -func (m *ClusterStatusProblemsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ClusterStatusProblemsItems0) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ClusterStatusProblemsItems0) UnmarshalBinary(b []byte) error { - var res ClusterStatusProblemsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/cluster-registry/models/cluster_update.go b/pkg/cluster-registry/models/cluster_update.go deleted file mode 100644 index 2abd1e48..00000000 --- a/pkg/cluster-registry/models/cluster_update.go +++ /dev/null @@ -1,224 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ClusterUpdate cluster update -// -// swagger:model ClusterUpdate -type ClusterUpdate struct { - - // Human readable alias for the Kubernetes cluster. The alias is unique - // but can be changed. - // - // Example: production-cluster - Alias string `json:"alias,omitempty"` - - // URL of the Kubernetes API server endpoint - // Example: https://kube-1.foo.example.org/ - APIServerURL string `json:"api_server_url,omitempty"` - - // A version channel for the cluster. Possible values are "alpha", "stable" - // Example: alpha - Channel string `json:"channel,omitempty"` - - // Configuration items unique to the cluster. E.g. custom API key used - // by one of the cluster services. - // - // Example: {"product_x_key":"abcde","product_y_key":"12345"} - ConfigItems map[string]string `json:"config_items,omitempty"` - - // Level of criticality as defined by tech controlling. 1 is non - // critical, 2 is standard production, 3 is PCI. - // - // Example: 2 - CriticalityLevel int32 `json:"criticality_level,omitempty"` - - // The environment in which the cluster run. - // - // Example: production - Environment string `json:"environment,omitempty"` - - // Globally unique ID of the Kubernetes cluster - // Example: aws:123456789012:eu-central-1:kube-1 - ID string `json:"id,omitempty"` - - // The identifier of the infrastructure account in which the cluster will - // live in - // - // Example: aws:123456789012 - InfrastructureAccount string `json:"infrastructure_account,omitempty"` - - // Status of the cluster. - // Example: ready - // Enum: ["requested","creating","ready","decommission-requested","decommissioned"] - LifecycleStatus string `json:"lifecycle_status,omitempty"` - - // Cluster identifier which is local to the region - // Example: kube-1 - LocalID string `json:"local_id,omitempty"` - - // The provider of the cluster. Possible values are "zalando-aws", "GKE", ... - // Example: zalando-aws - Provider string `json:"provider,omitempty"` - - // The region of the cluster - // Example: eu-central-1 - Region string `json:"region,omitempty"` - - // status - Status *ClusterStatus `json:"status,omitempty"` -} - -// Validate validates this cluster update -func (m *ClusterUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLifecycleStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var clusterUpdateTypeLifecycleStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["requested","creating","ready","decommission-requested","decommissioned"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - clusterUpdateTypeLifecycleStatusPropEnum = append(clusterUpdateTypeLifecycleStatusPropEnum, v) - } -} - -const ( - - // ClusterUpdateLifecycleStatusRequested captures enum value "requested" - ClusterUpdateLifecycleStatusRequested string = "requested" - - // ClusterUpdateLifecycleStatusCreating captures enum value "creating" - ClusterUpdateLifecycleStatusCreating string = "creating" - - // ClusterUpdateLifecycleStatusReady captures enum value "ready" - ClusterUpdateLifecycleStatusReady string = "ready" - - // ClusterUpdateLifecycleStatusDecommissionDashRequested captures enum value "decommission-requested" - ClusterUpdateLifecycleStatusDecommissionDashRequested string = "decommission-requested" - - // ClusterUpdateLifecycleStatusDecommissioned captures enum value "decommissioned" - ClusterUpdateLifecycleStatusDecommissioned string = "decommissioned" -) - -// prop value enum -func (m *ClusterUpdate) validateLifecycleStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, clusterUpdateTypeLifecycleStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *ClusterUpdate) validateLifecycleStatus(formats strfmt.Registry) error { - if swag.IsZero(m.LifecycleStatus) { // not required - return nil - } - - // value enum - if err := m.validateLifecycleStatusEnum("lifecycle_status", "body", m.LifecycleStatus); err != nil { - return err - } - - return nil -} - -func (m *ClusterUpdate) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required - return nil - } - - if m.Status != nil { - if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - } - - return nil -} - -// ContextValidate validate this cluster update based on the context it is used -func (m *ClusterUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ClusterUpdate) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if m.Status != nil { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ClusterUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ClusterUpdate) UnmarshalBinary(b []byte) error { - var res ClusterUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/cluster-registry/models/config_value.go b/pkg/cluster-registry/models/config_value.go deleted file mode 100644 index 7bc8e6e3..00000000 --- a/pkg/cluster-registry/models/config_value.go +++ /dev/null @@ -1,72 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ConfigValue config value -// -// swagger:model ConfigValue -type ConfigValue struct { - - // Value of the Config value. - // Example: secret-key-id - // Required: true - Value *string `json:"value"` -} - -// Validate validates this config value -func (m *ConfigValue) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateValue(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ConfigValue) validateValue(formats strfmt.Registry) error { - - if err := validate.Required("value", "body", m.Value); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this config value based on context it is used -func (m *ConfigValue) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ConfigValue) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ConfigValue) UnmarshalBinary(b []byte) error { - var res ConfigValue - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/cluster-registry/models/error.go b/pkg/cluster-registry/models/error.go deleted file mode 100644 index 43fed233..00000000 --- a/pkg/cluster-registry/models/error.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// Error error -// -// swagger:model Error -type Error struct { - - // code - Code int32 `json:"code,omitempty"` - - // fields - Fields string `json:"fields,omitempty"` - - // message - Message string `json:"message,omitempty"` -} - -// Validate validates this error -func (m *Error) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this error based on context it is used -func (m *Error) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *Error) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Error) UnmarshalBinary(b []byte) error { - var res Error - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/cluster-registry/models/infrastructure_account.go b/pkg/cluster-registry/models/infrastructure_account.go deleted file mode 100644 index e1f359f2..00000000 --- a/pkg/cluster-registry/models/infrastructure_account.go +++ /dev/null @@ -1,257 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// InfrastructureAccount infrastructure account -// -// swagger:model InfrastructureAccount -type InfrastructureAccount struct { - - // Cost center of the Owner/infrastructure account - // Example: 0000001234 - // Required: true - CostCenter *string `json:"cost_center"` - - // Level of criticality as defined by tech controlling. 1 is non critical, 2 is standard production, 3 is PCI - // Example: 2 - // Required: true - CriticalityLevel *int32 `json:"criticality_level"` - - // Environment. possible values are "production" or "test". - // Example: production - // Required: true - Environment *string `json:"environment"` - - // The external identifier of the account (i.e. AWS account ID) - // Example: 123456789012 - // Required: true - ExternalID *string `json:"external_id"` - - // Globally unique ID of the infrastructure account. - // Example: aws:123456789012 - // Required: true - ID *string `json:"id"` - - // Lifecycle Status is used to describe the current status of the account. - // Required: true - // Enum: ["requested","creating","ready","decommissioned"] - LifecycleStatus *string `json:"lifecycle_status"` - - // Name of the infrastructure account - // Example: foo - // Required: true - Name *string `json:"name"` - - // Owner of the infrastructure account (references an object in the organization service) - // Example: team/bar - // Required: true - Owner *string `json:"owner"` - - // Type of the infrastructure account. Possible types are "aws", "gcp", "dc". - // Example: aws - // Required: true - Type *string `json:"type"` -} - -// Validate validates this infrastructure account -func (m *InfrastructureAccount) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCostCenter(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCriticalityLevel(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEnvironment(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExternalID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLifecycleStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOwner(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *InfrastructureAccount) validateCostCenter(formats strfmt.Registry) error { - - if err := validate.Required("cost_center", "body", m.CostCenter); err != nil { - return err - } - - return nil -} - -func (m *InfrastructureAccount) validateCriticalityLevel(formats strfmt.Registry) error { - - if err := validate.Required("criticality_level", "body", m.CriticalityLevel); err != nil { - return err - } - - return nil -} - -func (m *InfrastructureAccount) validateEnvironment(formats strfmt.Registry) error { - - if err := validate.Required("environment", "body", m.Environment); err != nil { - return err - } - - return nil -} - -func (m *InfrastructureAccount) validateExternalID(formats strfmt.Registry) error { - - if err := validate.Required("external_id", "body", m.ExternalID); err != nil { - return err - } - - return nil -} - -func (m *InfrastructureAccount) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -var infrastructureAccountTypeLifecycleStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["requested","creating","ready","decommissioned"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - infrastructureAccountTypeLifecycleStatusPropEnum = append(infrastructureAccountTypeLifecycleStatusPropEnum, v) - } -} - -const ( - - // InfrastructureAccountLifecycleStatusRequested captures enum value "requested" - InfrastructureAccountLifecycleStatusRequested string = "requested" - - // InfrastructureAccountLifecycleStatusCreating captures enum value "creating" - InfrastructureAccountLifecycleStatusCreating string = "creating" - - // InfrastructureAccountLifecycleStatusReady captures enum value "ready" - InfrastructureAccountLifecycleStatusReady string = "ready" - - // InfrastructureAccountLifecycleStatusDecommissioned captures enum value "decommissioned" - InfrastructureAccountLifecycleStatusDecommissioned string = "decommissioned" -) - -// prop value enum -func (m *InfrastructureAccount) validateLifecycleStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, infrastructureAccountTypeLifecycleStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *InfrastructureAccount) validateLifecycleStatus(formats strfmt.Registry) error { - - if err := validate.Required("lifecycle_status", "body", m.LifecycleStatus); err != nil { - return err - } - - // value enum - if err := m.validateLifecycleStatusEnum("lifecycle_status", "body", *m.LifecycleStatus); err != nil { - return err - } - - return nil -} - -func (m *InfrastructureAccount) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *InfrastructureAccount) validateOwner(formats strfmt.Registry) error { - - if err := validate.Required("owner", "body", m.Owner); err != nil { - return err - } - - return nil -} - -func (m *InfrastructureAccount) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this infrastructure account based on context it is used -func (m *InfrastructureAccount) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *InfrastructureAccount) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *InfrastructureAccount) UnmarshalBinary(b []byte) error { - var res InfrastructureAccount - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/cluster-registry/models/infrastructure_account_update.go b/pkg/cluster-registry/models/infrastructure_account_update.go deleted file mode 100644 index 4c8af5bb..00000000 --- a/pkg/cluster-registry/models/infrastructure_account_update.go +++ /dev/null @@ -1,148 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// InfrastructureAccountUpdate infrastructure account update -// -// swagger:model InfrastructureAccountUpdate -type InfrastructureAccountUpdate struct { - - // Cost center of the Owner/infrastructure account - // Example: 0000001234 - CostCenter string `json:"cost_center,omitempty"` - - // Level of criticality as defined by tech controlling. 1 is non - // critical, 2 is standard production, 3 is PCI - // - // Example: 2 - CriticalityLevel int32 `json:"criticality_level,omitempty"` - - // Environment. possible values are "production" or "test". - // - // Example: production - Environment string `json:"environment,omitempty"` - - // The external identifier of the account (i.e. AWS account ID) - // Example: 123456789012 - ExternalID string `json:"external_id,omitempty"` - - // Globally unique ID of the infrastructure account. - // Example: aws:123456789012 - ID string `json:"id,omitempty"` - - // Lifecycle Status is used to describe the current status of the account. - // Enum: ["requested","creating","ready","decommissioned"] - LifecycleStatus string `json:"lifecycle_status,omitempty"` - - // Name of the infrastructure account - // Example: foo - Name string `json:"name,omitempty"` - - // Owner of the infrastructure account (references an object in the organization service) - // Example: team/bar - Owner string `json:"owner,omitempty"` - - // Type of the infrastructure account. Possible types are "aws", "gcp", - // "dc". - // - // Example: aws - Type string `json:"type,omitempty"` -} - -// Validate validates this infrastructure account update -func (m *InfrastructureAccountUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLifecycleStatus(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var infrastructureAccountUpdateTypeLifecycleStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["requested","creating","ready","decommissioned"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - infrastructureAccountUpdateTypeLifecycleStatusPropEnum = append(infrastructureAccountUpdateTypeLifecycleStatusPropEnum, v) - } -} - -const ( - - // InfrastructureAccountUpdateLifecycleStatusRequested captures enum value "requested" - InfrastructureAccountUpdateLifecycleStatusRequested string = "requested" - - // InfrastructureAccountUpdateLifecycleStatusCreating captures enum value "creating" - InfrastructureAccountUpdateLifecycleStatusCreating string = "creating" - - // InfrastructureAccountUpdateLifecycleStatusReady captures enum value "ready" - InfrastructureAccountUpdateLifecycleStatusReady string = "ready" - - // InfrastructureAccountUpdateLifecycleStatusDecommissioned captures enum value "decommissioned" - InfrastructureAccountUpdateLifecycleStatusDecommissioned string = "decommissioned" -) - -// prop value enum -func (m *InfrastructureAccountUpdate) validateLifecycleStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, infrastructureAccountUpdateTypeLifecycleStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *InfrastructureAccountUpdate) validateLifecycleStatus(formats strfmt.Registry) error { - if swag.IsZero(m.LifecycleStatus) { // not required - return nil - } - - // value enum - if err := m.validateLifecycleStatusEnum("lifecycle_status", "body", m.LifecycleStatus); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this infrastructure account update based on context it is used -func (m *InfrastructureAccountUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *InfrastructureAccountUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *InfrastructureAccountUpdate) UnmarshalBinary(b []byte) error { - var res InfrastructureAccountUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/cluster-registry/models/node_pool.go b/pkg/cluster-registry/models/node_pool.go deleted file mode 100644 index dfc74911..00000000 --- a/pkg/cluster-registry/models/node_pool.go +++ /dev/null @@ -1,186 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NodePool node pool -// -// swagger:model NodePool -type NodePool struct { - - // Configuration items unique to the node pool. E.g. custom volume - // configuration. - // - // Example: {"local_storage":"yes"} - ConfigItems map[string]string `json:"config_items,omitempty"` - - // A discount strategy indicates the type of discount to be associated - // with the node pool. This might affect the availability of the nodes in - // the pools in case of preemptible or spot instances. Possible values - // depend on the provider, the only common one is "none". - // - // Example: none - // Required: true - DiscountStrategy *string `json:"discount_strategy"` - - // instance types - // Required: true - // Min Items: 1 - // Unique: true - InstanceTypes []string `json:"instance_types"` - - // Maximum size of the node pool - // Example: 20 - // Required: true - MaxSize *int64 `json:"max_size"` - - // Minimum size of the node pool - // Example: 3 - // Required: true - MinSize *int64 `json:"min_size"` - - // Name of the node pool - // Example: pool-1 - // Required: true - Name *string `json:"name"` - - // Profile used for the node pool. Possible values are "worker-default", - // "worker-database", "worker-gpu", "master". The "master" profile - // identifies the pool containing the cluster master - // - // Example: worker-default - // Required: true - Profile *string `json:"profile"` -} - -// Validate validates this node pool -func (m *NodePool) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDiscountStrategy(formats); err != nil { - res = append(res, err) - } - - if err := m.validateInstanceTypes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMaxSize(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMinSize(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProfile(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NodePool) validateDiscountStrategy(formats strfmt.Registry) error { - - if err := validate.Required("discount_strategy", "body", m.DiscountStrategy); err != nil { - return err - } - - return nil -} - -func (m *NodePool) validateInstanceTypes(formats strfmt.Registry) error { - - if err := validate.Required("instance_types", "body", m.InstanceTypes); err != nil { - return err - } - - iInstanceTypesSize := int64(len(m.InstanceTypes)) - - if err := validate.MinItems("instance_types", "body", iInstanceTypesSize, 1); err != nil { - return err - } - - if err := validate.UniqueItems("instance_types", "body", m.InstanceTypes); err != nil { - return err - } - - return nil -} - -func (m *NodePool) validateMaxSize(formats strfmt.Registry) error { - - if err := validate.Required("max_size", "body", m.MaxSize); err != nil { - return err - } - - return nil -} - -func (m *NodePool) validateMinSize(formats strfmt.Registry) error { - - if err := validate.Required("min_size", "body", m.MinSize); err != nil { - return err - } - - return nil -} - -func (m *NodePool) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *NodePool) validateProfile(formats strfmt.Registry) error { - - if err := validate.Required("profile", "body", m.Profile); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this node pool based on context it is used -func (m *NodePool) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *NodePool) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NodePool) UnmarshalBinary(b []byte) error { - var res NodePool - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/cluster-registry/models/node_pool_update.go b/pkg/cluster-registry/models/node_pool_update.go deleted file mode 100644 index 05e0dfd0..00000000 --- a/pkg/cluster-registry/models/node_pool_update.go +++ /dev/null @@ -1,114 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NodePoolUpdate node pool update -// -// swagger:model NodePoolUpdate -type NodePoolUpdate struct { - - // Configuration items unique to the node pool. E.g. custom volume - // configuration. - // - // Example: {"local_storage":"yes"} - ConfigItems map[string]string `json:"config_items,omitempty"` - - // A discount strategy indicates the type of discount to be associated - // with the node pool. This might affect the availability of the nodes in - // the pools in case of preemptible or spot instances. Possible values - // depend on the provider, the only common one is "none". - // - // Example: none - DiscountStrategy string `json:"discount_strategy,omitempty"` - - // instance types - // Min Items: 1 - // Unique: true - InstanceTypes []string `json:"instance_types"` - - // Maximum size of the node pool - // Example: 20 - MaxSize int64 `json:"max_size,omitempty"` - - // Minimum size of the node pool - // Example: 3 - MinSize int64 `json:"min_size,omitempty"` - - // Name of the node pool - // Example: pool-1 - Name string `json:"name,omitempty"` - - // Profile used for the node pool. Possible values are "worker-default", - // "worker-database", "worker-gpu", "master". The "master" profile - // identifies the pool containing the cluster master - // - // Example: worker-default - Profile string `json:"profile,omitempty"` -} - -// Validate validates this node pool update -func (m *NodePoolUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateInstanceTypes(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NodePoolUpdate) validateInstanceTypes(formats strfmt.Registry) error { - if swag.IsZero(m.InstanceTypes) { // not required - return nil - } - - iInstanceTypesSize := int64(len(m.InstanceTypes)) - - if err := validate.MinItems("instance_types", "body", iInstanceTypesSize, 1); err != nil { - return err - } - - if err := validate.UniqueItems("instance_types", "body", m.InstanceTypes); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this node pool update based on context it is used -func (m *NodePoolUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *NodePoolUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NodePoolUpdate) UnmarshalBinary(b []byte) error { - var res NodePoolUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/provisioner/clusterpy.go b/provisioner/clusterpy.go index 96ec785b..73f93f0a 100644 --- a/provisioner/clusterpy.go +++ b/provisioner/clusterpy.go @@ -16,11 +16,11 @@ import ( "github.com/cenkalti/backoff" "github.com/pkg/errors" log "github.com/sirupsen/logrus" + "github.com/zalando-build/cluster-registry/models" "github.com/zalando-incubator/cluster-lifecycle-manager/api" "github.com/zalando-incubator/cluster-lifecycle-manager/channel" "github.com/zalando-incubator/cluster-lifecycle-manager/config" awsUtils "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/aws" - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/models" "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/decrypter" "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/kubernetes" "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/updatestrategy" diff --git a/registry/http.go b/registry/http.go index c6785856..094348bf 100644 --- a/registry/http.go +++ b/registry/http.go @@ -12,12 +12,12 @@ import ( "github.com/go-openapi/strfmt" "github.com/samber/lo" + apiclient "github.com/zalando-build/cluster-registry/client" + "github.com/zalando-build/cluster-registry/client/clusters" + "github.com/zalando-build/cluster-registry/client/config_items" + "github.com/zalando-build/cluster-registry/client/infrastructure_accounts" + "github.com/zalando-build/cluster-registry/models" "github.com/zalando-incubator/cluster-lifecycle-manager/api" - apiclient "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/client" - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/client/clusters" - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/client/config_items" - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/client/infrastructure_accounts" - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/models" ) type httpRegistry struct { diff --git a/registry/http_test.go b/registry/http_test.go index 49ae3919..758213cd 100644 --- a/registry/http_test.go +++ b/registry/http_test.go @@ -8,8 +8,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/stretchr/testify/require" + "github.com/zalando-build/cluster-registry/models" "github.com/zalando-incubator/cluster-lifecycle-manager/api" - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/models" "golang.org/x/oauth2" ) diff --git a/registry/registry.go b/registry/registry.go index 152d4a48..04398051 100644 --- a/registry/registry.go +++ b/registry/registry.go @@ -4,8 +4,8 @@ import ( "log" "net/url" + "github.com/zalando-build/cluster-registry/models" "github.com/zalando-incubator/cluster-lifecycle-manager/api" - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/models" "golang.org/x/oauth2" ) diff --git a/registry/registry_test.go b/registry/registry_test.go index bacc8a43..47001a04 100644 --- a/registry/registry_test.go +++ b/registry/registry_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/aws" - "github.com/zalando-incubator/cluster-lifecycle-manager/pkg/cluster-registry/models" + "github.com/zalando-build/cluster-registry/models" ) func TestFilter(t *testing.T) {