diff --git a/go.mod b/go.mod index f3b4835..9cb7ad4 100644 --- a/go.mod +++ b/go.mod @@ -6,12 +6,14 @@ toolchain go1.22.3 require ( github.com/AlekSi/pointer v1.2.0 - github.com/cosmtrek/air v1.40.4 - github.com/deepmap/oapi-codegen v1.9.0 - github.com/getkin/kin-openapi v0.98.0 - github.com/hashicorp/golang-lru v0.5.4 + github.com/cosmtrek/air v1.52.0 + github.com/deepmap/oapi-codegen v1.16.2 + github.com/deepmap/oapi-codegen/v2 v2.1.0 + github.com/getkin/kin-openapi v0.123.0 + github.com/hashicorp/golang-lru v1.0.2 github.com/labstack/echo/v4 v4.12.0 - github.com/projectsyn/lieutenant-operator v1.5.0 + github.com/oapi-codegen/runtime v1.1.1 + github.com/projectsyn/lieutenant-operator v1.5.3 github.com/stretchr/testify v1.9.0 github.com/taion809/haikunator v0.0.0-20150324135039-4e414e676fd1 k8s.io/api v0.30.1 @@ -20,43 +22,59 @@ require ( ) require ( - github.com/creack/pty v1.1.11 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect + dario.cat/mergo v1.0.0 // indirect + github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect + github.com/bep/godartsass v1.2.0 // indirect + github.com/bep/godartsass/v2 v2.0.0 // indirect + github.com/bep/golibsass v1.1.1 // indirect + github.com/cli/safeexec v1.0.1 // indirect + github.com/creack/pty v1.1.21 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/emicklei/go-restful/v3 v3.12.0 // indirect - github.com/evanphx/json-patch v5.6.0+incompatible // indirect + github.com/evanphx/json-patch v5.9.0+incompatible // indirect github.com/evanphx/json-patch/v5 v5.9.0 // indirect - github.com/fatih/color v1.13.0 // indirect + github.com/fatih/color v1.17.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-openapi/jsonpointer v0.21.0 // indirect github.com/go-openapi/jsonreference v0.21.0 // indirect github.com/go-openapi/swag v0.23.0 // indirect + github.com/gobwas/glob v0.2.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect + github.com/gohugoio/hugo v0.126.1 // indirect github.com/golang-jwt/jwt v3.2.2+incompatible // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/gnostic-models v0.6.8 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/gorilla/mux v1.8.0 // indirect + github.com/gorilla/mux v1.8.1 // indirect github.com/imdario/mergo v0.3.16 // indirect - github.com/invopop/yaml v0.1.0 // indirect + github.com/invopop/yaml v0.3.1 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/labstack/gommon v0.4.2 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mitchellh/hashstructure v1.1.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pelletier/go-toml v1.9.5 // indirect + github.com/pelletier/go-toml/v2 v2.2.2 // indirect + github.com/perimeterx/marshmallow v1.1.5 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/spf13/afero v1.11.0 // indirect + github.com/spf13/cast v1.6.0 // indirect github.com/spf13/pflag v1.0.5 // indirect + github.com/tdewolff/minify/v2 v2.20.31 // indirect + github.com/tdewolff/parse/v2 v2.7.14 // indirect + github.com/ugorji/go/codec v1.2.12 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasttemplate v1.2.2 // indirect golang.org/x/crypto v0.23.0 // indirect - golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.25.0 // indirect golang.org/x/oauth2 v0.20.0 // indirect diff --git a/go.sum b/go.sum index f3393ba..71fdd98 100644 --- a/go.sum +++ b/go.sum @@ -1,73 +1,144 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= +dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/AlekSi/pointer v1.2.0 h1:glcy/gc4h8HnG2Z3ZECSzZ1IX1x2JxRVuDzaJwQE0+w= github.com/AlekSi/pointer v1.2.0/go.mod h1:gZGfd3dpW4vEc/UlyfKKi1roIqcCgwOIvb0tSNSBle0= -github.com/cosmtrek/air v1.40.4 h1:AjSlvS7IofbSf4m0BkJLm6TnBlfREwkJ9eCmLR3FLHc= -github.com/cosmtrek/air v1.40.4/go.mod h1:Urz3nl9UBvc/rntZkXRBttYWt4sBeh2NZaGcdBbkNak= +github.com/BurntSushi/locker v0.0.0-20171006230638-a6e239ea1c69 h1:+tu3HOoMXB7RXEINRVIpxJCT+KdYiI7LAEAUrOw3dIU= +github.com/BurntSushi/locker v0.0.0-20171006230638-a6e239ea1c69/go.mod h1:L1AbZdiDllfyYH5l5OkAaZtk7VkWe89bPJFmnDBNHxg= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk= +github.com/alecthomas/chroma/v2 v2.13.0 h1:VP72+99Fb2zEcYM0MeaWJmV+xQvz5v5cxRHd+ooU1lI= +github.com/alecthomas/chroma/v2 v2.13.0/go.mod h1:BUGjjsD+ndS6eX37YgTchSEG+Jg9Jv1GiZs9sqPqztk= +github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ= +github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk= +github.com/armon/go-radix v1.0.1-0.20221118154546-54df44f2176c h1:651/eoCRnQ7YtSjAnSzRucrJz+3iGEFt+ysraELS81M= +github.com/armon/go-radix v1.0.1-0.20221118154546-54df44f2176c/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/bep/clocks v0.5.0 h1:hhvKVGLPQWRVsBP/UB7ErrHYIO42gINVbvqxvYTPVps= +github.com/bep/clocks v0.5.0/go.mod h1:SUq3q+OOq41y2lRQqH5fsOoxN8GbxSiT6jvoVVLCVhU= +github.com/bep/debounce v1.2.0 h1:wXds8Kq8qRfwAOpAxHrJDbCXgC5aHSzgQb/0gKsHQqo= +github.com/bep/debounce v1.2.0/go.mod h1:H8yggRPQKLUhUoqrJC1bO2xNya7vanpDl7xR3ISbCJ0= +github.com/bep/gitmap v1.1.2 h1:zk04w1qc1COTZPPYWDQHvns3y1afOsdRfraFQ3qI840= +github.com/bep/gitmap v1.1.2/go.mod h1:g9VRETxFUXNWzMiuxOwcudo6DfZkW9jOsOW0Ft4kYaY= +github.com/bep/goat v0.5.0 h1:S8jLXHCVy/EHIoCY+btKkmcxcXFd34a0Q63/0D4TKeA= +github.com/bep/goat v0.5.0/go.mod h1:Md9x7gRxiWKs85yHlVTvHQw9rg86Bm+Y4SuYE8CTH7c= +github.com/bep/godartsass v1.2.0 h1:E2VvQrxAHAFwbjyOIExAMmogTItSKodoKuijNrGm5yU= +github.com/bep/godartsass v1.2.0/go.mod h1:6LvK9RftsXMxGfsA0LDV12AGc4Jylnu6NgHL+Q5/pE8= +github.com/bep/godartsass/v2 v2.0.0 h1:Ruht+BpBWkpmW+yAM2dkp7RSSeN0VLaTobyW0CiSP3Y= +github.com/bep/godartsass/v2 v2.0.0/go.mod h1:AcP8QgC+OwOXEq6im0WgDRYK7scDsmZCEW62o1prQLo= +github.com/bep/golibsass v1.1.1 h1:xkaet75ygImMYjM+FnHIT3xJn7H0xBA9UxSOJjk8Khw= +github.com/bep/golibsass v1.1.1/go.mod h1:DL87K8Un/+pWUS75ggYv41bliGiolxzDKWJAq3eJ1MA= +github.com/bep/gowebp v0.3.0 h1:MhmMrcf88pUY7/PsEhMgEP0T6fDUnRTMpN8OclDrbrY= +github.com/bep/gowebp v0.3.0/go.mod h1:ZhFodwdiFp8ehGJpF4LdPl6unxZm9lLFjxD3z2h2AgI= +github.com/bep/lazycache v0.4.0 h1:X8yVyWNVupPd4e1jV7efi3zb7ZV/qcjKQgIQ5aPbkYI= +github.com/bep/lazycache v0.4.0/go.mod h1:NmRm7Dexh3pmR1EignYR8PjO2cWybFQ68+QgY3VMCSc= +github.com/bep/logg v0.4.0 h1:luAo5mO4ZkhA5M1iDVDqDqnBBnlHjmtZF6VAyTp+nCQ= +github.com/bep/logg v0.4.0/go.mod h1:Ccp9yP3wbR1mm++Kpxet91hAZBEQgmWgFgnXX3GkIV0= +github.com/bep/overlayfs v0.9.2 h1:qJEmFInsW12L7WW7dOTUhnMfyk/fN9OCDEO5Gr8HSDs= +github.com/bep/overlayfs v0.9.2/go.mod h1:aYY9W7aXQsGcA7V9x/pzeR8LjEgIxbtisZm8Q7zPz40= +github.com/bep/tmc v0.5.1 h1:CsQnSC6MsomH64gw0cT5f+EwQDcvZz4AazKunFwTpuI= +github.com/bep/tmc v0.5.1/go.mod h1:tGYHN8fS85aJPhDLgXETVKp+PR382OvFi2+q2GkGsq0= +github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME= +github.com/clbanning/mxj/v2 v2.7.0/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s= +github.com/cli/safeexec v1.0.0/go.mod h1:Z/D4tTN8Vs5gXYHDCbaM1S/anmEDnJb1iW0+EJ5zx3Q= +github.com/cli/safeexec v1.0.1 h1:e/C79PbXF4yYTN/wauC4tviMxEV13BwljGj0N9j+N00= +github.com/cli/safeexec v1.0.1/go.mod h1:Z/D4tTN8Vs5gXYHDCbaM1S/anmEDnJb1iW0+EJ5zx3Q= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cosmtrek/air v1.52.0 h1:fCMADJfEdcBE84oyhChPXv2XS5A1jUN/uLo49ivCnlI= +github.com/cosmtrek/air v1.52.0/go.mod h1:xILtq8JGIYwe++r/ib4PdhubiuKBmE1vutC49E+5A78= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= -github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= +github.com/creack/pty v1.1.21 h1:1/QdRyBaHHJP61QkWMXlOIBfsgdDeeKfK8SYVUWJKf0= +github.com/creack/pty v1.1.21/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.0-20210816181553-5444fa50b93d/go.mod h1:tmAIfUFEirG/Y8jhZ9M+h36obRZAk/1fcSpXwAVlfqE= -github.com/deepmap/oapi-codegen v1.9.0 h1:qpyRY+dzjMai5QejjA53ebnBtcSvIcZOtYwVlsgdxOc= -github.com/deepmap/oapi-codegen v1.9.0/go.mod h1:7t4DbSxmAffcTEgrWvsPYEE2aOARZ8ZKWp3hDuZkHNc= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/deepmap/oapi-codegen v1.16.2 h1:xGHx0dNqYfy9gE8a7AVgVM8Sd5oF9SEgePzP+UPAUXI= +github.com/deepmap/oapi-codegen v1.16.2/go.mod h1:rdYoEA2GE+riuZ91DvpmBX9hJbQpuY9wchXpfQ3n+ho= +github.com/deepmap/oapi-codegen/v2 v2.1.0 h1:I/NMVhJCtuvL9x+S2QzZKpSjGi33oDZwPRdemvOZWyQ= +github.com/deepmap/oapi-codegen/v2 v2.1.0/go.mod h1:R1wL226vc5VmCNJUvMyYr3hJMm5reyv25j952zAVXZ8= +github.com/disintegration/gift v1.2.1 h1:Y005a1X4Z7Uc+0gLpSAsKhWi4qLtsdEcMIbbdvdZ6pc= +github.com/disintegration/gift v1.2.1/go.mod h1:Jh2i7f7Q2BM7Ezno3PhfezbR1xpUg9dUg3/RlKGr4HI= +github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI= +github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/emicklei/go-restful/v3 v3.12.0 h1:y2DdzBAURM29NFF94q6RaY4vjIH1rtwDapwQtU84iWk= github.com/emicklei/go-restful/v3 v3.12.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= -github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/evanphx/json-patch v5.9.0+incompatible h1:fBXyNpNMuTTDdquAq/uisOr2lShz4oaXpDTX2bLe7ls= +github.com/evanphx/json-patch v5.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg= github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= -github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= -github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/evanw/esbuild v0.20.2 h1:E4Y0iJsothpUCq7y0D+ERfqpJmPWrZpNybJA3x3I4p8= +github.com/evanw/esbuild v0.20.2/go.mod h1:D2vIQZqV/vIf/VRHtViaUtViZmG7o+kKmlBfVQuRi48= +github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= +github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= +github.com/frankban/quicktest v1.7.2/go.mod h1:jaStnuzAqU1AJdCO0l53JDCJrVDKcS03DbaAcR7Ks/o= +github.com/frankban/quicktest v1.14.2/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= -github.com/getkin/kin-openapi v0.80.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= -github.com/getkin/kin-openapi v0.98.0 h1:lIACvCG9cxmFsEywz+LCoVhcZHFLUy+Nv5QSkb43eAE= -github.com/getkin/kin-openapi v0.98.0/go.mod h1:w4lRPHiyOdwGbOkLIyk+P0qCwlu7TXPCHD/64nSXzgE= +github.com/getkin/kin-openapi v0.123.0 h1:zIik0mRwFNLyvtXK274Q6ut+dPh6nlxBp0x7mNrPhs8= +github.com/getkin/kin-openapi v0.123.0/go.mod h1:wb1aSZA/iWmorQP9KTAS/phLj/t17B5jT7+fS8ed9NM= +github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.7.4/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= -github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= -github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= -github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= -github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= -github.com/go-playground/validator/v10 v10.9.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= -github.com/goccy/go-json v0.7.8/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/go-test/deep v1.1.0 h1:WOcxcdHcvdgThNXjw0t76K42FXTU7HpNQWHpA2HHNlg= +github.com/go-test/deep v1.1.0/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= +github.com/gobuffalo/flect v1.0.2 h1:eqjPGSo2WmjgY2XlpGwo2NXgL3RucAKo4k4qQMNA5sA= +github.com/gobuffalo/flect v1.0.2/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs= +github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= +github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/gohugoio/go-i18n/v2 v2.1.3-0.20230805085216-e63c13218d0e h1:QArsSubW7eDh8APMXkByjQWvuljwPGAGQpJEFn0F0wY= +github.com/gohugoio/go-i18n/v2 v2.1.3-0.20230805085216-e63c13218d0e/go.mod h1:3Ltoo9Banwq0gOtcOwxuHG6omk+AwsQPADyw2vQYOJQ= +github.com/gohugoio/hugo v0.126.1 h1:jzs1VX6Ru/NR0luf4Z9ahKLVmYzQEox4Cxd/kyzgN9A= +github.com/gohugoio/hugo v0.126.1/go.mod h1:wo66RnKrp9Mx0WeeF22LJxPY6YB+v2weKdZpHa8fI/A= +github.com/gohugoio/hugo-goldmark-extensions/extras v0.1.0 h1:YhxZNU8y2vxV6Ibr7QJzzUlpr8oHHWX/l+Q1R/a5Zao= +github.com/gohugoio/hugo-goldmark-extensions/extras v0.1.0/go.mod h1:0cuvOnGKW7WeXA3i7qK6IS07FH1bgJ2XzOjQ7BMJYH4= +github.com/gohugoio/hugo-goldmark-extensions/passthrough v0.2.0 h1:PCtO5l++psZf48yen2LxQ3JiOXxaRC6v0594NeHvGZg= +github.com/gohugoio/hugo-goldmark-extensions/passthrough v0.2.0/go.mod h1:g9CCh+Ci2IMbPUrVJuXbBTrA+rIIx5+hDQ4EXYaQDoM= +github.com/gohugoio/locales v0.14.0 h1:Q0gpsZwfv7ATHMbcTNepFd59H7GoykzWJIxi113XGDc= +github.com/gohugoio/locales v0.14.0/go.mod h1:ip8cCAv/cnmVLzzXtiTpPwgJ4xhKZranqNqtoIu0b/4= +github.com/gohugoio/localescompressed v1.0.1 h1:KTYMi8fCWYLswFyJAeOtuk/EkXR/KPTHHNN9OS+RTxo= +github.com/gohugoio/localescompressed v1.0.1/go.mod h1:jBF6q8D7a0vaEmcWPNcAjUZLJaIVNiwvM3WlmTvooB0= github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= -github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219 h1:utua3L2IbQJmauC5IXdEA547bcoU5dozgQAfc8Onsg4= -github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219/go.mod h1:/X8TswGSh1pIozq4ZwCfxS0WA5JGXguxk94ar/4c87Y= github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -78,23 +149,28 @@ github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 h1:k7nVchz72niMH6YLQN github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= -github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= +github.com/hairyhenderson/go-codeowners v0.4.0 h1:Wx/tRXb07sCyHeC8mXfio710Iu35uAy5KYiBdLHdv4Q= +github.com/hairyhenderson/go-codeowners v0.4.0/go.mod h1:iJgZeCt+W/GzXo5uchFCqvVHZY2T4TAIpvuVlKVkLxc= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= -github.com/invopop/yaml v0.1.0 h1:YW3WGUoJEXYfzWBjn00zIlrw7brGVD0fUKRYDPAPhrc= -github.com/invopop/yaml v0.1.0/go.mod h1:2XuRLgs/ouIrW3XNzuNj7J3Nvu/Dig5MXvbCEdiBN3Q= +github.com/invopop/yaml v0.3.1 h1:f0+ZpmhfBSS4MhG+4HYseMdJhoeeopbSKbq5Rpeelso= +github.com/invopop/yaml v0.3.1/go.mod h1:PMOp3nn4/12yEZUFfmOuNHJsZToEEOwoWsT+D81KkeA= +github.com/jdkato/prose v1.2.1 h1:Fp3UnJmLVISmlc57BgKUzdjr0lOtjqTZicL3PaYy6cU= +github.com/jdkato/prose v1.2.1/go.mod h1:AiRHgVagnEx2JbQRQowVBKjG0bcs/vtkGCH1dYAL1rA= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= @@ -102,184 +178,202 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= -github.com/labstack/echo/v4 v4.9.1 h1:GliPYSpzGKlyOhqIbG8nmHBo3i1saKWFOgh41AN3b+Y= -github.com/labstack/echo/v4 v4.9.1/go.mod h1:Pop5HLc+xoc4qhTZ1ip6C0RtP7Z+4VzRLWZZFKqbbjo= +github.com/kyokomi/emoji/v2 v2.2.12 h1:sSVA5nH9ebR3Zji1o31wu3yOwD1zKXQA2z0zUyeit60= +github.com/kyokomi/emoji/v2 v2.2.12/go.mod h1:JUcn42DTdsXJo1SWanHh4HKDEyPaR5CqkmoirZZP9qE= github.com/labstack/echo/v4 v4.12.0 h1:IKpw49IMryVB2p1a4dzwlhP1O2Tf2E0Ir/450lH+kI0= github.com/labstack/echo/v4 v4.12.0/go.mod h1:UP9Cr2DJXbOK3Kr9ONYzNowSh7HP0aG0ShAyycHSJvM= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= -github.com/labstack/gommon v0.4.0 h1:y7cvthEAEbU0yHOf4axH8ZG2NH8knB9iNSoTO8dyIk8= -github.com/labstack/gommon v0.4.0/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM= github.com/labstack/gommon v0.4.2 h1:F8qTUNXgG1+6WQmqoUWnz8WiEU60mXVVw0P4ht1WRA0= github.com/labstack/gommon v0.4.2/go.mod h1:QlUFxVM+SNXhDL/Z7YhocGIBYOiwB0mXm1+1bAPHPyU= -github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= -github.com/lestrrat-go/backoff/v2 v2.0.8/go.mod h1:rHP/q/r9aT27n24JQLa7JhSQZCKBBOiM/uP402WwN8Y= -github.com/lestrrat-go/blackmagic v1.0.0/go.mod h1:TNgH//0vYSs8VXDCfkZLgIrVTTXQELZffUV0tz3MtdQ= -github.com/lestrrat-go/codegen v1.0.2/go.mod h1:JhJw6OQAuPEfVKUCLItpaVLumDGWQznd1VaXrBk9TdM= -github.com/lestrrat-go/httpcc v1.0.0/go.mod h1:tGS/u00Vh5N6FHNkExqGGNId8e0Big+++0Gf8MBnAvE= -github.com/lestrrat-go/iter v1.0.1/go.mod h1:zIdgO1mRKhn8l9vrZJZz9TUMMFbQbLeTsbqPDrJ/OJc= -github.com/lestrrat-go/jwx v1.2.7/go.mod h1:bw24IXWbavc0R2RsOtpXL7RtMyP589yZ1+L7kd09ZGA= -github.com/lestrrat-go/option v1.0.0/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= -github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= -github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/makeworld-the-better-one/dither/v2 v2.4.0 h1:Az/dYXiTcwcRSe59Hzw4RI1rSnAZns+1msaCXetrMFE= +github.com/makeworld-the-better-one/dither/v2 v2.4.0/go.mod h1:VBtN8DXO7SNtyGmLiGA7IsFeKrBkQPze1/iAeM95arc= +github.com/marekm4/color-extractor v1.2.1 h1:3Zb2tQsn6bITZ8MBVhc33Qn1k5/SEuZ18mrXGUqIwn0= +github.com/marekm4/color-extractor v1.2.1/go.mod h1:90VjmiHI6M8ez9eYUaXLdcKnS+BAOp7w+NpwBdkJmpA= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= +github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mitchellh/hashstructure v1.1.0 h1:P6P1hdjqAAknpY/M1CGipelZgp+4y9ja9kmUZPXP+H0= +github.com/mitchellh/hashstructure v1.1.0/go.mod h1:xUDAozZz0Wmdiufv0uyhnHkUTN6/6d8ulp4AwfLKrmA= +github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c h1:cqn374mizHuIWj+OSJCajGr/phAmuMug9qIX3l9CflE= +github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= +github.com/muesli/smartcrop v0.3.0 h1:JTlSkmxWg/oQ1TcLDoypuirdE8Y/jzNirQeLkxpA6Oc= +github.com/muesli/smartcrop v0.3.0/go.mod h1:i2fCI/UorTfgEpPPLWiFBv4pye+YAG78RwcQLUkocpI= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/niklasfasching/go-org v1.7.0 h1:vyMdcMWWTe/XmANk19F4k8XGBYg0GQ/gJGMimOjGMek= +github.com/niklasfasching/go-org v1.7.0/go.mod h1:WuVm4d45oePiE0eX25GqTDQIt/qPW1T9DGkRscqLW5o= +github.com/oapi-codegen/runtime v1.1.1 h1:EXLHh0DXIJnWhdRPN2w4MXAzFyE4CskzhNLUmtpMYro= +github.com/oapi-codegen/runtime v1.1.1/go.mod h1:SK9X900oXmPWilYR5/WKPzt3Kqxn/uS/+lbpREv+eCg= +github.com/oapi-codegen/testutil v1.0.0 h1:1GI2IiMMLh2vDHr1OkNacaYU/VaApKdcmfgl4aeXAa8= +github.com/oapi-codegen/testutil v1.0.0/go.mod h1:ttCaYbHvJtHuiyeBF0tPIX+4uhEPTeizXKx28okijLw= +github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= +github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo/v2 v2.17.2 h1:7eMhcy3GimbsA3hEnVKdw/PQM9XN9krpKVXsZdph0/g= github.com/onsi/ginkgo/v2 v2.17.2/go.mod h1:nP2DPOQoNsQmsVyv5rDA8JkXQoCs6goXIvr/PRJ1eCc= github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0= +github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 h1:onHthvaw9LFnH4t2DcNVpwGmV9E1BkGknEliJkfwQj0= +github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58/go.mod h1:DXv8WO4yhMYhSNPKjeNKa5WY9YCIEBRbNzFFPJbWO6Y= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= +github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= +github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s= +github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/projectsyn/lieutenant-operator v1.5.0 h1:HqZbmsN2kixgGWas5kTJe89UzX9dgj7wTavxycm2dBw= -github.com/projectsyn/lieutenant-operator v1.5.0/go.mod h1:cUAUGJ5QyKkqdv5IHaSVB2JnaEqf4cyMElCWxbB1dqc= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/projectsyn/lieutenant-operator v1.5.3 h1:n2gIWvws+hy5WxbcgiW5Pf3lNbcsrEC6vL9DBzp1Ves= +github.com/projectsyn/lieutenant-operator v1.5.3/go.mod h1:JIIxR4epvsV57V1nb+f1yIFZ4wQJAgvpnkCrmY/xowA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd h1:CmH9+J6ZSsIjUK3dcGsnCnO41eRBOnY12zwkn5qVwgc= +github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd/go.mod h1:hPqNNc0+uJM6H+SuU8sEs5K5IQeKccPqeSjfgcKGgPk= +github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= +github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= +github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= +github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/taion809/haikunator v0.0.0-20150324135039-4e414e676fd1 h1:Othyd9BE5Cc1J1FhMKEcZo732qwHjxU1+qFAy9qxyMI= github.com/taion809/haikunator v0.0.0-20150324135039-4e414e676fd1/go.mod h1:YN59p3Qc11j61wypGtx03FU7uXUpuNfn29TmeCkg9ys= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go v1.2.6/go.mod h1:anCg0y61KIhDlPZmnH+so+RQbysYVyDko0IMgJv0Nn0= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/ugorji/go/codec v1.2.6/go.mod h1:V6TCNZ4PHqoHGFZuSG1W8nrCzzdgA2DozYxWFFpvxTw= +github.com/tdewolff/minify/v2 v2.20.31 h1:c0vQzZU6WaGCTDUYDrii2UQIy4yLdJUvh2KTjnYXBp0= +github.com/tdewolff/minify/v2 v2.20.31/go.mod h1:1TJni7+mATKu24cBQQpgwakrYRD27uC1/rdJOgdv8ns= +github.com/tdewolff/parse/v2 v2.7.14 h1:100KJ+QAO3PpMb3uUjzEU/NpmCdbBYz6KPmCIAfWpR8= +github.com/tdewolff/parse/v2 v2.7.14/go.mod h1:3FbJWZp3XT9OWVN3Hmfp0p/a08v4h8J9W1aghka0soA= +github.com/tdewolff/test v1.0.11-0.20231101010635-f1265d231d52/go.mod h1:6DAvZliBAAnD7rhVgwaM7DE5/d9NMOAJ09SqYqeK4QE= +github.com/tdewolff/test v1.0.11-0.20240106005702-7de5f7df4739 h1:IkjBCtQOOjIn03u/dMQK9g+Iw9ewps4mCl1nB8Sscbo= +github.com/tdewolff/test v1.0.11-0.20240106005702-7de5f7df4739/go.mod h1:XPuWBzvdUzhCuxWO1ojpXsyzsA5bFoS3tO/Q3kFuTG8= +github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= +github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1 h1:TVEnxayobAdVkhQfrfes2IzOB6o+z4roRkPF52WA1u4= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo= github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.7.1 h1:3bajkSilaCbjdKVsKdZjZCLBNPL9pYzrCakKaf4U49U= +github.com/yuin/goldmark v1.7.1/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= +github.com/yuin/goldmark-emoji v1.0.2 h1:c/RgTShNgHTtc6xdz2KKI74jJr6rWi7FPgnP9GAsO5s= +github.com/yuin/goldmark-emoji v1.0.2/go.mod h1:RhP/RWpexdp+KHs7ghKnifRoIs/Bq4nDS7tRbCkOwKY= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= 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.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201217014255-9d1352758620/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM= golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= +golang.org/x/image v0.16.0 h1:9kloLAKhUufZhA12l5fwnx2NZW39/we1UhBesW433jw= +golang.org/x/image v0.16.0/go.mod h1:ugSZItdV4nOxyqp56HmXwH0Ry0nBCpjnZdpDaIHdoPs= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-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-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211031064116-611d5d643895/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200918232735-d647fc253266/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210114065538-d78b04bdf963/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.21.0 h1:qc0xYgIbsSDt9EyWz05J5wfa7LOVW0YTLOXrqdLAWIw= golang.org/x/tools v0.21.0/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -289,16 +383,14 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EV gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= k8s.io/api v0.30.1 h1:kCm/6mADMdbAxmIh0LBjS54nQBE+U4KmbCfIkF5CpJY= k8s.io/api v0.30.1/go.mod h1:ddbN2C0+0DIiPntan/bye3SW3PdwLa11/0yqwvuRrJM= k8s.io/apiextensions-apiserver v0.30.1 h1:4fAJZ9985BmpJG6PkoxVRpXv9vmPUOVzl614xarePws= diff --git a/main.go b/main.go index 5c05476..f0ab5c7 100644 --- a/main.go +++ b/main.go @@ -1,5 +1,4 @@ -//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen -package=api -o=pkg/api/openapi.go -generate=types,server,spec openapi.yaml -//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen -package=api -o=pkg/api/client.go -generate=client openapi.yaml +//go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config oapi-codegen.conf openapi.yaml package main diff --git a/oapi-codegen.conf b/oapi-codegen.conf new file mode 100644 index 0000000..e6b552c --- /dev/null +++ b/oapi-codegen.conf @@ -0,0 +1,12 @@ +package: api +generate: + echo-server: true + client: true + models: true + embedded-spec: true +compatibility: + old-merge-schemas: true + old-aliasing: true + old-enum-conflicts: true + disable-required-readonly-as-pointer: true +output: pkg/api/openapi.go diff --git a/openapi.yaml b/openapi.yaml index fcb5a70..20d2596 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -33,7 +33,6 @@ components: description: > A unique object identifier string. Automatically generated by the API on creation (in the form "---" where all letters are lowercase, max 63 characters in total). - readOnly: true OIDCConfig: type: object required: @@ -79,8 +78,6 @@ components: example: v1.2.3 TenantId: type: object - required: - - id properties: id: $ref: '#/components/schemas/Id' @@ -139,8 +136,6 @@ components: - $ref: '#/components/schemas/ClusterProperties' ClusterId: type: object - required: - - id properties: id: $ref: '#/components/schemas/Id' diff --git a/pkg/api/client.go b/pkg/api/client.go deleted file mode 100644 index 376edd8..0000000 --- a/pkg/api/client.go +++ /dev/null @@ -1,2568 +0,0 @@ -// Package api provides primitives to interact with the openapi HTTP API. -// -// Code generated by github.com/deepmap/oapi-codegen version v1.9.0 DO NOT EDIT. -package api - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "io" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/deepmap/oapi-codegen/pkg/runtime" -) - -// RequestEditorFn is the function signature for the RequestEditor callback function -type RequestEditorFn func(ctx context.Context, req *http.Request) error - -// Doer performs HTTP requests. -// -// The standard http.Client implements this interface. -type HttpRequestDoer interface { - Do(req *http.Request) (*http.Response, error) -} - -// Client which conforms to the OpenAPI3 specification for this service. -type Client struct { - // The endpoint of the server conforming to this interface, with scheme, - // https://api.deepmap.com for example. This can contain a path relative - // to the server, such as https://api.deepmap.com/dev-test, and all the - // paths in the swagger spec will be appended to the server. - Server string - - // Doer for performing requests, typically a *http.Client with any - // customized settings, such as certificate chains. - Client HttpRequestDoer - - // A list of callbacks for modifying requests which are generated before sending over - // the network. - RequestEditors []RequestEditorFn -} - -// ClientOption allows setting custom parameters during construction -type ClientOption func(*Client) error - -// Creates a new Client, with reasonable defaults -func NewClient(server string, opts ...ClientOption) (*Client, error) { - // create a client with sane default values - client := Client{ - Server: server, - } - // mutate client and add all optional params - for _, o := range opts { - if err := o(&client); err != nil { - return nil, err - } - } - // ensure the server URL always has a trailing slash - if !strings.HasSuffix(client.Server, "/") { - client.Server += "/" - } - // create httpClient, if not already present - if client.Client == nil { - client.Client = &http.Client{} - } - return &client, nil -} - -// WithHTTPClient allows overriding the default Doer, which is -// automatically created using http.Client. This is useful for tests. -func WithHTTPClient(doer HttpRequestDoer) ClientOption { - return func(c *Client) error { - c.Client = doer - return nil - } -} - -// WithRequestEditorFn allows setting up a callback function, which will be -// called right before sending the request. This can be used to mutate the request. -func WithRequestEditorFn(fn RequestEditorFn) ClientOption { - return func(c *Client) error { - c.RequestEditors = append(c.RequestEditors, fn) - return nil - } -} - -// The interface specification for the client above. -type ClientInterface interface { - // Discovery request - Discovery(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - - // ListClusters request - ListClusters(ctx context.Context, params *ListClustersParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // CreateCluster request with any body - CreateClusterWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - CreateCluster(ctx context.Context, body CreateClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // DeleteCluster request - DeleteCluster(ctx context.Context, clusterId ClusterIdParameter, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetCluster request - GetCluster(ctx context.Context, clusterId ClusterIdParameter, reqEditors ...RequestEditorFn) (*http.Response, error) - - // UpdateCluster request with any body - UpdateClusterWithBody(ctx context.Context, clusterId ClusterIdParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - // PutCluster request with any body - PutClusterWithBody(ctx context.Context, clusterId ClusterIdParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - PutCluster(ctx context.Context, clusterId ClusterIdParameter, body PutClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // Docs request - Docs(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - - // Healthz request - Healthz(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - - // InstallSteward request - InstallSteward(ctx context.Context, params *InstallStewardParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // QueryInventory request - QueryInventory(ctx context.Context, params *QueryInventoryParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // UpdateInventory request with any body - UpdateInventoryWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - UpdateInventory(ctx context.Context, body UpdateInventoryJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // Openapi request - Openapi(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - - // ListTenants request - ListTenants(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - - // CreateTenant request with any body - CreateTenantWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - CreateTenant(ctx context.Context, body CreateTenantJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // DeleteTenant request - DeleteTenant(ctx context.Context, tenantId TenantIdParameter, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetTenant request - GetTenant(ctx context.Context, tenantId TenantIdParameter, reqEditors ...RequestEditorFn) (*http.Response, error) - - // UpdateTenant request with any body - UpdateTenantWithBody(ctx context.Context, tenantId TenantIdParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - // PutTenant request with any body - PutTenantWithBody(ctx context.Context, tenantId TenantIdParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - PutTenant(ctx context.Context, tenantId TenantIdParameter, body PutTenantJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) -} - -func (c *Client) Discovery(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDiscoveryRequest(c.Server) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) ListClusters(ctx context.Context, params *ListClustersParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewListClustersRequest(c.Server, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) CreateClusterWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateClusterRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) CreateCluster(ctx context.Context, body CreateClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateClusterRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) DeleteCluster(ctx context.Context, clusterId ClusterIdParameter, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteClusterRequest(c.Server, clusterId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetCluster(ctx context.Context, clusterId ClusterIdParameter, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetClusterRequest(c.Server, clusterId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) UpdateClusterWithBody(ctx context.Context, clusterId ClusterIdParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateClusterRequestWithBody(c.Server, clusterId, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) PutClusterWithBody(ctx context.Context, clusterId ClusterIdParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPutClusterRequestWithBody(c.Server, clusterId, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) PutCluster(ctx context.Context, clusterId ClusterIdParameter, body PutClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPutClusterRequest(c.Server, clusterId, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) Docs(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDocsRequest(c.Server) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) Healthz(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewHealthzRequest(c.Server) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) InstallSteward(ctx context.Context, params *InstallStewardParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewInstallStewardRequest(c.Server, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) QueryInventory(ctx context.Context, params *QueryInventoryParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewQueryInventoryRequest(c.Server, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) UpdateInventoryWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateInventoryRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) UpdateInventory(ctx context.Context, body UpdateInventoryJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateInventoryRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) Openapi(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewOpenapiRequest(c.Server) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) ListTenants(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewListTenantsRequest(c.Server) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) CreateTenantWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateTenantRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) CreateTenant(ctx context.Context, body CreateTenantJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateTenantRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) DeleteTenant(ctx context.Context, tenantId TenantIdParameter, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteTenantRequest(c.Server, tenantId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetTenant(ctx context.Context, tenantId TenantIdParameter, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetTenantRequest(c.Server, tenantId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) UpdateTenantWithBody(ctx context.Context, tenantId TenantIdParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateTenantRequestWithBody(c.Server, tenantId, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) PutTenantWithBody(ctx context.Context, tenantId TenantIdParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPutTenantRequestWithBody(c.Server, tenantId, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) PutTenant(ctx context.Context, tenantId TenantIdParameter, body PutTenantJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPutTenantRequest(c.Server, tenantId, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -// NewDiscoveryRequest generates requests for Discovery -func NewDiscoveryRequest(server string) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewListClustersRequest generates requests for ListClusters -func NewListClustersRequest(server string, params *ListClustersParams) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/clusters") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - queryValues := queryURL.Query() - - if params.Tenant != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "tenant", runtime.ParamLocationQuery, *params.Tenant); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.SortBy != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sort_by", runtime.ParamLocationQuery, *params.SortBy); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewCreateClusterRequest calls the generic CreateCluster builder with application/json body -func NewCreateClusterRequest(server string, body CreateClusterJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewCreateClusterRequestWithBody(server, "application/json", bodyReader) -} - -// NewCreateClusterRequestWithBody generates requests for CreateCluster with any type of body -func NewCreateClusterRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/clusters") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewDeleteClusterRequest generates requests for DeleteCluster -func NewDeleteClusterRequest(server string, clusterId ClusterIdParameter) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clusterId", runtime.ParamLocationPath, clusterId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/clusters/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("DELETE", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGetClusterRequest generates requests for GetCluster -func NewGetClusterRequest(server string, clusterId ClusterIdParameter) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clusterId", runtime.ParamLocationPath, clusterId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/clusters/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewUpdateClusterRequestWithBody generates requests for UpdateCluster with any type of body -func NewUpdateClusterRequestWithBody(server string, clusterId ClusterIdParameter, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clusterId", runtime.ParamLocationPath, clusterId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/clusters/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("PATCH", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewPutClusterRequest calls the generic PutCluster builder with application/json body -func NewPutClusterRequest(server string, clusterId ClusterIdParameter, body PutClusterJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewPutClusterRequestWithBody(server, clusterId, "application/json", bodyReader) -} - -// NewPutClusterRequestWithBody generates requests for PutCluster with any type of body -func NewPutClusterRequestWithBody(server string, clusterId ClusterIdParameter, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clusterId", runtime.ParamLocationPath, clusterId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/clusters/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("PUT", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewDocsRequest generates requests for Docs -func NewDocsRequest(server string) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/docs") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewHealthzRequest generates requests for Healthz -func NewHealthzRequest(server string) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/healthz") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewInstallStewardRequest generates requests for InstallSteward -func NewInstallStewardRequest(server string, params *InstallStewardParams) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/install/steward.json") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - queryValues := queryURL.Query() - - if params.Token != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "token", runtime.ParamLocationQuery, *params.Token); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewQueryInventoryRequest generates requests for QueryInventory -func NewQueryInventoryRequest(server string, params *QueryInventoryParams) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/inventory") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - queryValues := queryURL.Query() - - if params.Q != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "q", runtime.ParamLocationQuery, *params.Q); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewUpdateInventoryRequest calls the generic UpdateInventory builder with application/json body -func NewUpdateInventoryRequest(server string, body UpdateInventoryJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewUpdateInventoryRequestWithBody(server, "application/json", bodyReader) -} - -// NewUpdateInventoryRequestWithBody generates requests for UpdateInventory with any type of body -func NewUpdateInventoryRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/inventory") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewOpenapiRequest generates requests for Openapi -func NewOpenapiRequest(server string) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/openapi.json") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewListTenantsRequest generates requests for ListTenants -func NewListTenantsRequest(server string) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/tenants") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewCreateTenantRequest calls the generic CreateTenant builder with application/json body -func NewCreateTenantRequest(server string, body CreateTenantJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewCreateTenantRequestWithBody(server, "application/json", bodyReader) -} - -// NewCreateTenantRequestWithBody generates requests for CreateTenant with any type of body -func NewCreateTenantRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/tenants") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewDeleteTenantRequest generates requests for DeleteTenant -func NewDeleteTenantRequest(server string, tenantId TenantIdParameter) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "tenantId", runtime.ParamLocationPath, tenantId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/tenants/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("DELETE", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGetTenantRequest generates requests for GetTenant -func NewGetTenantRequest(server string, tenantId TenantIdParameter) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "tenantId", runtime.ParamLocationPath, tenantId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/tenants/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewUpdateTenantRequestWithBody generates requests for UpdateTenant with any type of body -func NewUpdateTenantRequestWithBody(server string, tenantId TenantIdParameter, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "tenantId", runtime.ParamLocationPath, tenantId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/tenants/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("PATCH", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewPutTenantRequest calls the generic PutTenant builder with application/json body -func NewPutTenantRequest(server string, tenantId TenantIdParameter, body PutTenantJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewPutTenantRequestWithBody(server, tenantId, "application/json", bodyReader) -} - -// NewPutTenantRequestWithBody generates requests for PutTenant with any type of body -func NewPutTenantRequestWithBody(server string, tenantId TenantIdParameter, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "tenantId", runtime.ParamLocationPath, tenantId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/tenants/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("PUT", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { - for _, r := range c.RequestEditors { - if err := r(ctx, req); err != nil { - return err - } - } - for _, r := range additionalEditors { - if err := r(ctx, req); err != nil { - return err - } - } - return nil -} - -// ClientWithResponses builds on ClientInterface to offer response payloads -type ClientWithResponses struct { - ClientInterface -} - -// NewClientWithResponses creates a new ClientWithResponses, which wraps -// Client with return type handling -func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { - client, err := NewClient(server, opts...) - if err != nil { - return nil, err - } - return &ClientWithResponses{client}, nil -} - -// WithBaseURL overrides the baseURL. -func WithBaseURL(baseURL string) ClientOption { - return func(c *Client) error { - newBaseURL, err := url.Parse(baseURL) - if err != nil { - return err - } - c.Server = newBaseURL.String() - return nil - } -} - -// ClientWithResponsesInterface is the interface specification for the client with responses above. -type ClientWithResponsesInterface interface { - // Discovery request - DiscoveryWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*DiscoveryResponse, error) - - // ListClusters request - ListClustersWithResponse(ctx context.Context, params *ListClustersParams, reqEditors ...RequestEditorFn) (*ListClustersResponse, error) - - // CreateCluster request with any body - CreateClusterWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateClusterResponse, error) - - CreateClusterWithResponse(ctx context.Context, body CreateClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateClusterResponse, error) - - // DeleteCluster request - DeleteClusterWithResponse(ctx context.Context, clusterId ClusterIdParameter, reqEditors ...RequestEditorFn) (*DeleteClusterResponse, error) - - // GetCluster request - GetClusterWithResponse(ctx context.Context, clusterId ClusterIdParameter, reqEditors ...RequestEditorFn) (*GetClusterResponse, error) - - // UpdateCluster request with any body - UpdateClusterWithBodyWithResponse(ctx context.Context, clusterId ClusterIdParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateClusterResponse, error) - - // PutCluster request with any body - PutClusterWithBodyWithResponse(ctx context.Context, clusterId ClusterIdParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutClusterResponse, error) - - PutClusterWithResponse(ctx context.Context, clusterId ClusterIdParameter, body PutClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*PutClusterResponse, error) - - // Docs request - DocsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*DocsResponse, error) - - // Healthz request - HealthzWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*HealthzResponse, error) - - // InstallSteward request - InstallStewardWithResponse(ctx context.Context, params *InstallStewardParams, reqEditors ...RequestEditorFn) (*InstallStewardResponse, error) - - // QueryInventory request - QueryInventoryWithResponse(ctx context.Context, params *QueryInventoryParams, reqEditors ...RequestEditorFn) (*QueryInventoryResponse, error) - - // UpdateInventory request with any body - UpdateInventoryWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateInventoryResponse, error) - - UpdateInventoryWithResponse(ctx context.Context, body UpdateInventoryJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateInventoryResponse, error) - - // Openapi request - OpenapiWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*OpenapiResponse, error) - - // ListTenants request - ListTenantsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListTenantsResponse, error) - - // CreateTenant request with any body - CreateTenantWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTenantResponse, error) - - CreateTenantWithResponse(ctx context.Context, body CreateTenantJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTenantResponse, error) - - // DeleteTenant request - DeleteTenantWithResponse(ctx context.Context, tenantId TenantIdParameter, reqEditors ...RequestEditorFn) (*DeleteTenantResponse, error) - - // GetTenant request - GetTenantWithResponse(ctx context.Context, tenantId TenantIdParameter, reqEditors ...RequestEditorFn) (*GetTenantResponse, error) - - // UpdateTenant request with any body - UpdateTenantWithBodyWithResponse(ctx context.Context, tenantId TenantIdParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateTenantResponse, error) - - // PutTenant request with any body - PutTenantWithBodyWithResponse(ctx context.Context, tenantId TenantIdParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutTenantResponse, error) - - PutTenantWithResponse(ctx context.Context, tenantId TenantIdParameter, body PutTenantJSONRequestBody, reqEditors ...RequestEditorFn) (*PutTenantResponse, error) -} - -type DiscoveryResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Metadata - JSONDefault *Reason -} - -// Status returns HTTPResponse.Status -func (r DiscoveryResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r DiscoveryResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type ListClustersResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *[]Cluster - JSONDefault *Reason -} - -// Status returns HTTPResponse.Status -func (r ListClustersResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r ListClustersResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type CreateClusterResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *Cluster - JSON400 *Reason - JSONDefault *Reason -} - -// Status returns HTTPResponse.Status -func (r CreateClusterResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r CreateClusterResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type DeleteClusterResponse struct { - Body []byte - HTTPResponse *http.Response - JSON403 *Reason - JSONDefault *Reason -} - -// Status returns HTTPResponse.Status -func (r DeleteClusterResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r DeleteClusterResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetClusterResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Cluster - JSONDefault *Reason -} - -// Status returns HTTPResponse.Status -func (r GetClusterResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetClusterResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type UpdateClusterResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Cluster - JSON403 *Reason - JSONDefault *Reason -} - -// Status returns HTTPResponse.Status -func (r UpdateClusterResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r UpdateClusterResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type PutClusterResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Cluster - JSON201 *Cluster - JSON403 *Reason - JSONDefault *Reason -} - -// Status returns HTTPResponse.Status -func (r PutClusterResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r PutClusterResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type DocsResponse struct { - Body []byte - HTTPResponse *http.Response -} - -// Status returns HTTPResponse.Status -func (r DocsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r DocsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type HealthzResponse struct { - Body []byte - HTTPResponse *http.Response - JSONDefault *Reason -} - -// Status returns HTTPResponse.Status -func (r HealthzResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r HealthzResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type InstallStewardResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *map[string]interface{} - JSONDefault *Reason -} - -// Status returns HTTPResponse.Status -func (r InstallStewardResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r InstallStewardResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type QueryInventoryResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Inventory - JSONDefault *Reason -} - -// Status returns HTTPResponse.Status -func (r QueryInventoryResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r QueryInventoryResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type UpdateInventoryResponse struct { - Body []byte - HTTPResponse *http.Response - JSONDefault *Reason -} - -// Status returns HTTPResponse.Status -func (r UpdateInventoryResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r UpdateInventoryResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type OpenapiResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *map[string]interface{} -} - -// Status returns HTTPResponse.Status -func (r OpenapiResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r OpenapiResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type ListTenantsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *[]Tenant - JSONDefault *Reason -} - -// Status returns HTTPResponse.Status -func (r ListTenantsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r ListTenantsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type CreateTenantResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *Tenant - JSON400 *Reason - JSONDefault *Reason -} - -// Status returns HTTPResponse.Status -func (r CreateTenantResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r CreateTenantResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type DeleteTenantResponse struct { - Body []byte - HTTPResponse *http.Response - JSON403 *Reason - JSONDefault *Reason -} - -// Status returns HTTPResponse.Status -func (r DeleteTenantResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r DeleteTenantResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetTenantResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Tenant - JSONDefault *Reason -} - -// Status returns HTTPResponse.Status -func (r GetTenantResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetTenantResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type UpdateTenantResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Tenant - JSON403 *Reason - JSONDefault *Reason -} - -// Status returns HTTPResponse.Status -func (r UpdateTenantResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r UpdateTenantResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type PutTenantResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Tenant - JSON201 *Tenant - JSON403 *Reason - JSONDefault *Reason -} - -// Status returns HTTPResponse.Status -func (r PutTenantResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r PutTenantResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -// DiscoveryWithResponse request returning *DiscoveryResponse -func (c *ClientWithResponses) DiscoveryWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*DiscoveryResponse, error) { - rsp, err := c.Discovery(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParseDiscoveryResponse(rsp) -} - -// ListClustersWithResponse request returning *ListClustersResponse -func (c *ClientWithResponses) ListClustersWithResponse(ctx context.Context, params *ListClustersParams, reqEditors ...RequestEditorFn) (*ListClustersResponse, error) { - rsp, err := c.ListClusters(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseListClustersResponse(rsp) -} - -// CreateClusterWithBodyWithResponse request with arbitrary body returning *CreateClusterResponse -func (c *ClientWithResponses) CreateClusterWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateClusterResponse, error) { - rsp, err := c.CreateClusterWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateClusterResponse(rsp) -} - -func (c *ClientWithResponses) CreateClusterWithResponse(ctx context.Context, body CreateClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateClusterResponse, error) { - rsp, err := c.CreateCluster(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateClusterResponse(rsp) -} - -// DeleteClusterWithResponse request returning *DeleteClusterResponse -func (c *ClientWithResponses) DeleteClusterWithResponse(ctx context.Context, clusterId ClusterIdParameter, reqEditors ...RequestEditorFn) (*DeleteClusterResponse, error) { - rsp, err := c.DeleteCluster(ctx, clusterId, reqEditors...) - if err != nil { - return nil, err - } - return ParseDeleteClusterResponse(rsp) -} - -// GetClusterWithResponse request returning *GetClusterResponse -func (c *ClientWithResponses) GetClusterWithResponse(ctx context.Context, clusterId ClusterIdParameter, reqEditors ...RequestEditorFn) (*GetClusterResponse, error) { - rsp, err := c.GetCluster(ctx, clusterId, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetClusterResponse(rsp) -} - -// UpdateClusterWithBodyWithResponse request with arbitrary body returning *UpdateClusterResponse -func (c *ClientWithResponses) UpdateClusterWithBodyWithResponse(ctx context.Context, clusterId ClusterIdParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateClusterResponse, error) { - rsp, err := c.UpdateClusterWithBody(ctx, clusterId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdateClusterResponse(rsp) -} - -// PutClusterWithBodyWithResponse request with arbitrary body returning *PutClusterResponse -func (c *ClientWithResponses) PutClusterWithBodyWithResponse(ctx context.Context, clusterId ClusterIdParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutClusterResponse, error) { - rsp, err := c.PutClusterWithBody(ctx, clusterId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePutClusterResponse(rsp) -} - -func (c *ClientWithResponses) PutClusterWithResponse(ctx context.Context, clusterId ClusterIdParameter, body PutClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*PutClusterResponse, error) { - rsp, err := c.PutCluster(ctx, clusterId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePutClusterResponse(rsp) -} - -// DocsWithResponse request returning *DocsResponse -func (c *ClientWithResponses) DocsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*DocsResponse, error) { - rsp, err := c.Docs(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParseDocsResponse(rsp) -} - -// HealthzWithResponse request returning *HealthzResponse -func (c *ClientWithResponses) HealthzWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*HealthzResponse, error) { - rsp, err := c.Healthz(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParseHealthzResponse(rsp) -} - -// InstallStewardWithResponse request returning *InstallStewardResponse -func (c *ClientWithResponses) InstallStewardWithResponse(ctx context.Context, params *InstallStewardParams, reqEditors ...RequestEditorFn) (*InstallStewardResponse, error) { - rsp, err := c.InstallSteward(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseInstallStewardResponse(rsp) -} - -// QueryInventoryWithResponse request returning *QueryInventoryResponse -func (c *ClientWithResponses) QueryInventoryWithResponse(ctx context.Context, params *QueryInventoryParams, reqEditors ...RequestEditorFn) (*QueryInventoryResponse, error) { - rsp, err := c.QueryInventory(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseQueryInventoryResponse(rsp) -} - -// UpdateInventoryWithBodyWithResponse request with arbitrary body returning *UpdateInventoryResponse -func (c *ClientWithResponses) UpdateInventoryWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateInventoryResponse, error) { - rsp, err := c.UpdateInventoryWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdateInventoryResponse(rsp) -} - -func (c *ClientWithResponses) UpdateInventoryWithResponse(ctx context.Context, body UpdateInventoryJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateInventoryResponse, error) { - rsp, err := c.UpdateInventory(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdateInventoryResponse(rsp) -} - -// OpenapiWithResponse request returning *OpenapiResponse -func (c *ClientWithResponses) OpenapiWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*OpenapiResponse, error) { - rsp, err := c.Openapi(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParseOpenapiResponse(rsp) -} - -// ListTenantsWithResponse request returning *ListTenantsResponse -func (c *ClientWithResponses) ListTenantsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListTenantsResponse, error) { - rsp, err := c.ListTenants(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParseListTenantsResponse(rsp) -} - -// CreateTenantWithBodyWithResponse request with arbitrary body returning *CreateTenantResponse -func (c *ClientWithResponses) CreateTenantWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTenantResponse, error) { - rsp, err := c.CreateTenantWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateTenantResponse(rsp) -} - -func (c *ClientWithResponses) CreateTenantWithResponse(ctx context.Context, body CreateTenantJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTenantResponse, error) { - rsp, err := c.CreateTenant(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateTenantResponse(rsp) -} - -// DeleteTenantWithResponse request returning *DeleteTenantResponse -func (c *ClientWithResponses) DeleteTenantWithResponse(ctx context.Context, tenantId TenantIdParameter, reqEditors ...RequestEditorFn) (*DeleteTenantResponse, error) { - rsp, err := c.DeleteTenant(ctx, tenantId, reqEditors...) - if err != nil { - return nil, err - } - return ParseDeleteTenantResponse(rsp) -} - -// GetTenantWithResponse request returning *GetTenantResponse -func (c *ClientWithResponses) GetTenantWithResponse(ctx context.Context, tenantId TenantIdParameter, reqEditors ...RequestEditorFn) (*GetTenantResponse, error) { - rsp, err := c.GetTenant(ctx, tenantId, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetTenantResponse(rsp) -} - -// UpdateTenantWithBodyWithResponse request with arbitrary body returning *UpdateTenantResponse -func (c *ClientWithResponses) UpdateTenantWithBodyWithResponse(ctx context.Context, tenantId TenantIdParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateTenantResponse, error) { - rsp, err := c.UpdateTenantWithBody(ctx, tenantId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdateTenantResponse(rsp) -} - -// PutTenantWithBodyWithResponse request with arbitrary body returning *PutTenantResponse -func (c *ClientWithResponses) PutTenantWithBodyWithResponse(ctx context.Context, tenantId TenantIdParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutTenantResponse, error) { - rsp, err := c.PutTenantWithBody(ctx, tenantId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePutTenantResponse(rsp) -} - -func (c *ClientWithResponses) PutTenantWithResponse(ctx context.Context, tenantId TenantIdParameter, body PutTenantJSONRequestBody, reqEditors ...RequestEditorFn) (*PutTenantResponse, error) { - rsp, err := c.PutTenant(ctx, tenantId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePutTenantResponse(rsp) -} - -// ParseDiscoveryResponse parses an HTTP response from a DiscoveryWithResponse call -func ParseDiscoveryResponse(rsp *http.Response) (*DiscoveryResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &DiscoveryResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Metadata - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Reason - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParseListClustersResponse parses an HTTP response from a ListClustersWithResponse call -func ParseListClustersResponse(rsp *http.Response) (*ListClustersResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &ListClustersResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []Cluster - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Reason - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParseCreateClusterResponse parses an HTTP response from a CreateClusterWithResponse call -func ParseCreateClusterResponse(rsp *http.Response) (*CreateClusterResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &CreateClusterResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest Cluster - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON201 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest Reason - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Reason - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParseDeleteClusterResponse parses an HTTP response from a DeleteClusterWithResponse call -func ParseDeleteClusterResponse(rsp *http.Response) (*DeleteClusterResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &DeleteClusterResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: - var dest Reason - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON403 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Reason - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParseGetClusterResponse parses an HTTP response from a GetClusterWithResponse call -func ParseGetClusterResponse(rsp *http.Response) (*GetClusterResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetClusterResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Cluster - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Reason - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParseUpdateClusterResponse parses an HTTP response from a UpdateClusterWithResponse call -func ParseUpdateClusterResponse(rsp *http.Response) (*UpdateClusterResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &UpdateClusterResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Cluster - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: - var dest Reason - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON403 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Reason - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParsePutClusterResponse parses an HTTP response from a PutClusterWithResponse call -func ParsePutClusterResponse(rsp *http.Response) (*PutClusterResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &PutClusterResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Cluster - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest Cluster - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON201 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: - var dest Reason - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON403 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Reason - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParseDocsResponse parses an HTTP response from a DocsWithResponse call -func ParseDocsResponse(rsp *http.Response) (*DocsResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &DocsResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - return response, nil -} - -// ParseHealthzResponse parses an HTTP response from a HealthzWithResponse call -func ParseHealthzResponse(rsp *http.Response) (*HealthzResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &HealthzResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Reason - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParseInstallStewardResponse parses an HTTP response from a InstallStewardWithResponse call -func ParseInstallStewardResponse(rsp *http.Response) (*InstallStewardResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &InstallStewardResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest map[string]interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Reason - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParseQueryInventoryResponse parses an HTTP response from a QueryInventoryWithResponse call -func ParseQueryInventoryResponse(rsp *http.Response) (*QueryInventoryResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &QueryInventoryResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Inventory - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Reason - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParseUpdateInventoryResponse parses an HTTP response from a UpdateInventoryWithResponse call -func ParseUpdateInventoryResponse(rsp *http.Response) (*UpdateInventoryResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &UpdateInventoryResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Reason - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParseOpenapiResponse parses an HTTP response from a OpenapiWithResponse call -func ParseOpenapiResponse(rsp *http.Response) (*OpenapiResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &OpenapiResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest map[string]interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - } - - return response, nil -} - -// ParseListTenantsResponse parses an HTTP response from a ListTenantsWithResponse call -func ParseListTenantsResponse(rsp *http.Response) (*ListTenantsResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &ListTenantsResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []Tenant - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Reason - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParseCreateTenantResponse parses an HTTP response from a CreateTenantWithResponse call -func ParseCreateTenantResponse(rsp *http.Response) (*CreateTenantResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &CreateTenantResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest Tenant - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON201 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest Reason - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Reason - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParseDeleteTenantResponse parses an HTTP response from a DeleteTenantWithResponse call -func ParseDeleteTenantResponse(rsp *http.Response) (*DeleteTenantResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &DeleteTenantResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: - var dest Reason - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON403 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Reason - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParseGetTenantResponse parses an HTTP response from a GetTenantWithResponse call -func ParseGetTenantResponse(rsp *http.Response) (*GetTenantResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetTenantResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Tenant - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Reason - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParseUpdateTenantResponse parses an HTTP response from a UpdateTenantWithResponse call -func ParseUpdateTenantResponse(rsp *http.Response) (*UpdateTenantResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &UpdateTenantResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Tenant - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: - var dest Reason - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON403 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Reason - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParsePutTenantResponse parses an HTTP response from a PutTenantWithResponse call -func ParsePutTenantResponse(rsp *http.Response) (*PutTenantResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &PutTenantResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Tenant - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest Tenant - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON201 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: - var dest Reason - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON403 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Reason - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} diff --git a/pkg/api/openapi.go b/pkg/api/openapi.go index 42e98d9..4bfe408 100644 --- a/pkg/api/openapi.go +++ b/pkg/api/openapi.go @@ -1,28 +1,38 @@ // Package api provides primitives to interact with the openapi HTTP API. // -// Code generated by github.com/deepmap/oapi-codegen version v1.9.0 DO NOT EDIT. +// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.1.0 DO NOT EDIT. package api import ( "bytes" "compress/gzip" + "context" "encoding/base64" + "encoding/json" "fmt" + "io" "net/http" "net/url" "path" "strings" - "github.com/deepmap/oapi-codegen/pkg/runtime" "github.com/getkin/kin-openapi/openapi3" "github.com/labstack/echo/v4" + "github.com/oapi-codegen/runtime" ) const ( BearerAuthScopes = "BearerAuth.Scopes" ) -// Unstructured key value map containing arbitrary metadata +// Defines values for ListClustersParamsSortBy. +const ( + ListClustersParamsSortByDisplayName ListClustersParamsSortBy = "displayName" + ListClustersParamsSortById ListClustersParamsSortBy = "id" + ListClustersParamsSortByTenant ListClustersParamsSortBy = "tenant" +) + +// Annotations Unstructured key value map containing arbitrary metadata type Annotations map[string]interface{} // Cluster defines model for Cluster. @@ -35,74 +45,74 @@ type Cluster struct { ClusterProperties `yaml:",inline"` } -// Facts about a cluster object. Statically configured key/value pairs. +// ClusterFacts Facts about a cluster object. Statically configured key/value pairs. type ClusterFacts map[string]interface{} // ClusterId defines model for ClusterId. type ClusterId struct { - // A unique object identifier string. Automatically generated by the API on creation (in the form "---" where all letters are lowercase, max 63 characters in total). - Id Id `json:"id"` + // Id A unique object identifier string. Automatically generated by the API on creation (in the form "---" where all letters are lowercase, max 63 characters in total). + Id *Id `json:"id,omitempty"` } -// A cluster defition object. +// ClusterProperties A cluster defition object. // The Git repository is usually managed by the API and autogenerated. // The sshDeployKey will be managed by Steward type ClusterProperties struct { - // Unstructured key value map containing arbitrary metadata + // Annotations Unstructured key value map containing arbitrary metadata Annotations *Annotations `json:"annotations,omitempty"` - // Display Name of the cluster + // DisplayName Display Name of the cluster DisplayName *string `json:"displayName,omitempty"` - // Dynamic facts about a cluster object. Are periodically udpated by Project Syn and should not be set manually. + // DynamicFacts Dynamic facts about a cluster object. Are periodically udpated by Project Syn and should not be set manually. DynamicFacts *DynamicClusterFacts `json:"dynamicFacts,omitempty"` - // Facts about a cluster object. Statically configured key/value pairs. + // Facts Facts about a cluster object. Statically configured key/value pairs. Facts *ClusterFacts `json:"facts,omitempty"` - // Configuration Git repository, usually generated by the API + // GitRepo Configuration Git repository, usually generated by the API GitRepo *GitRepo `json:"gitRepo,omitempty"` - // Git revision to use with the global configruation git repository. + // GlobalGitRepoRevision Git revision to use with the global configruation git repository. // This takes precedence over the revision configured on the Tenant. GlobalGitRepoRevision *string `json:"globalGitRepoRevision,omitempty"` - // URL to fetch install manifests for Steward cluster agent. This will only be set if the cluster's token is still valid. + // InstallURL URL to fetch install manifests for Steward cluster agent. This will only be set if the cluster's token is still valid. InstallURL *string `json:"installURL,omitempty"` - // Git revision to use with the tenant configruation git repository. + // TenantGitRepoRevision Git revision to use with the tenant configruation git repository. // This takes precedence over the revision configured on the Tenant. TenantGitRepoRevision *string `json:"tenantGitRepoRevision,omitempty"` } // ClusterTenant defines model for ClusterTenant. type ClusterTenant struct { - // Id of the tenant this cluster belongs to + // Tenant Id of the tenant this cluster belongs to Tenant string `json:"tenant"` } -// Dynamic facts about a cluster object. Are periodically udpated by Project Syn and should not be set manually. +// DynamicClusterFacts Dynamic facts about a cluster object. Are periodically udpated by Project Syn and should not be set manually. type DynamicClusterFacts map[string]interface{} -// Configuration Git repository, usually generated by the API +// GitRepo Configuration Git repository, usually generated by the API type GitRepo struct { - // SSH public key / deploy key for clusterconfiguration catalog Git repository. This property is managed by Steward. + // DeployKey SSH public key / deploy key for clusterconfiguration catalog Git repository. This property is managed by Steward. DeployKey *string `json:"deployKey,omitempty"` - // SSH known hosts of the git server (multiline possible for multiple keys) + // HostKeys SSH known hosts of the git server (multiline possible for multiple keys) HostKeys *string `json:"hostKeys,omitempty"` - // Specifies if a repo should be managed by the git controller. A value of 'unmanaged' means it's not manged by the controller + // Type Specifies if a repo should be managed by the git controller. A value of 'unmanaged' means it's not manged by the controller Type *string `json:"type,omitempty"` - // Full URL of the git repo + // Url Full URL of the git repo Url *string `json:"url,omitempty"` } -// A unique object identifier string. Automatically generated by the API on creation (in the form "---" where all letters are lowercase, max 63 characters in total). +// Id A unique object identifier string. Automatically generated by the API on creation (in the form "---" where all letters are lowercase, max 63 characters in total). type Id string -// Inventory data of a cluster +// Inventory Inventory data of a cluster type Inventory struct { Cluster string `json:"cluster"` Inventory *map[string]interface{} `json:"inventory,omitempty"` @@ -120,15 +130,15 @@ type OIDCConfig struct { DiscoveryUrl string `json:"discoveryUrl"` } -// A reason for responses +// Reason A reason for responses type Reason struct { - // The reason message + // Reason The reason message Reason string `json:"reason"` } // Revision defines model for Revision. type Revision struct { - // Revision to use with a git repository. + // Revision Revision to use with a git repository. Revision *string `json:"revision,omitempty"` } @@ -150,90 +160,2707 @@ type Tenant struct { // TenantId defines model for TenantId. type TenantId struct { - // A unique object identifier string. Automatically generated by the API on creation (in the form "---" where all letters are lowercase, max 63 characters in total). - Id Id `json:"id"` + // Id A unique object identifier string. Automatically generated by the API on creation (in the form "---" where all letters are lowercase, max 63 characters in total). + Id *Id `json:"id,omitempty"` } -// A tenant definition object. +// TenantProperties A tenant definition object. // The Git repository is usually managed by the API and autogenerated. // All properties except name are optional on creation. type TenantProperties struct { - // Unstructured key value map containing arbitrary metadata + // Annotations Unstructured key value map containing arbitrary metadata Annotations *Annotations `json:"annotations,omitempty"` - // Display name of the tenant + // DisplayName Display name of the tenant DisplayName *string `json:"displayName,omitempty"` GitRepo *RevisionedGitRepo `json:"gitRepo,omitempty"` - // Git revision to use with the global configruation git repository. + // GlobalGitRepoRevision Git revision to use with the global configruation git repository. GlobalGitRepoRevision *string `json:"globalGitRepoRevision,omitempty"` - // Full URL of the global configuration git repo + // GlobalGitRepoURL Full URL of the global configuration git repo GlobalGitRepoURL *string `json:"globalGitRepoURL,omitempty"` } -// A unique object identifier string. Automatically generated by the API on creation (in the form "---" where all letters are lowercase, max 63 characters in total). +// ClusterIdParameter A unique object identifier string. Automatically generated by the API on creation (in the form "---" where all letters are lowercase, max 63 characters in total). type ClusterIdParameter Id -// A unique object identifier string. Automatically generated by the API on creation (in the form "---" where all letters are lowercase, max 63 characters in total). +// TenantIdParameter A unique object identifier string. Automatically generated by the API on creation (in the form "---" where all letters are lowercase, max 63 characters in total). type TenantIdParameter Id -// A reason for responses +// Default A reason for responses type Default Reason // ListClustersParams defines parameters for ListClusters. type ListClustersParams struct { - // Filter clusters by tenant id - Tenant *string `json:"tenant,omitempty"` + // Tenant Filter clusters by tenant id + Tenant *string `form:"tenant,omitempty" json:"tenant,omitempty"` - // Sort list by field - SortBy *ListClustersParamsSortBy `json:"sort_by,omitempty"` + // SortBy Sort list by field + SortBy *ListClustersParamsSortBy `form:"sort_by,omitempty" json:"sort_by,omitempty"` } // ListClustersParamsSortBy defines parameters for ListClusters. type ListClustersParamsSortBy string -// CreateClusterJSONBody defines parameters for CreateCluster. -type CreateClusterJSONBody Cluster - -// PutClusterJSONBody defines parameters for PutCluster. -type PutClusterJSONBody Cluster - // InstallStewardParams defines parameters for InstallSteward. type InstallStewardParams struct { - // Initial bootstrap token - Token *string `json:"token,omitempty"` + // Token Initial bootstrap token + Token *string `form:"token,omitempty" json:"token,omitempty"` } // QueryInventoryParams defines parameters for QueryInventory. type QueryInventoryParams struct { - // InfluxQL query string - Q *string `json:"q,omitempty"` + // Q InfluxQL query string + Q *string `form:"q,omitempty" json:"q,omitempty"` } -// UpdateInventoryJSONBody defines parameters for UpdateInventory. -type UpdateInventoryJSONBody Inventory - -// CreateTenantJSONBody defines parameters for CreateTenant. -type CreateTenantJSONBody Tenant - -// PutTenantJSONBody defines parameters for PutTenant. -type PutTenantJSONBody Tenant - // CreateClusterJSONRequestBody defines body for CreateCluster for application/json ContentType. -type CreateClusterJSONRequestBody CreateClusterJSONBody +type CreateClusterJSONRequestBody Cluster + +// UpdateClusterApplicationMergePatchPlusJSONRequestBody defines body for UpdateCluster for application/merge-patch+json ContentType. +type UpdateClusterApplicationMergePatchPlusJSONRequestBody ClusterProperties // PutClusterJSONRequestBody defines body for PutCluster for application/json ContentType. -type PutClusterJSONRequestBody PutClusterJSONBody +type PutClusterJSONRequestBody Cluster // UpdateInventoryJSONRequestBody defines body for UpdateInventory for application/json ContentType. -type UpdateInventoryJSONRequestBody UpdateInventoryJSONBody +type UpdateInventoryJSONRequestBody Inventory // CreateTenantJSONRequestBody defines body for CreateTenant for application/json ContentType. -type CreateTenantJSONRequestBody CreateTenantJSONBody +type CreateTenantJSONRequestBody Tenant + +// UpdateTenantApplicationMergePatchPlusJSONRequestBody defines body for UpdateTenant for application/merge-patch+json ContentType. +type UpdateTenantApplicationMergePatchPlusJSONRequestBody TenantProperties // PutTenantJSONRequestBody defines body for PutTenant for application/json ContentType. -type PutTenantJSONRequestBody PutTenantJSONBody +type PutTenantJSONRequestBody Tenant + +// RequestEditorFn is the function signature for the RequestEditor callback function +type RequestEditorFn func(ctx context.Context, req *http.Request) error + +// Doer performs HTTP requests. +// +// The standard http.Client implements this interface. +type HttpRequestDoer interface { + Do(req *http.Request) (*http.Response, error) +} + +// Client which conforms to the OpenAPI3 specification for this service. +type Client struct { + // The endpoint of the server conforming to this interface, with scheme, + // https://api.deepmap.com for example. This can contain a path relative + // to the server, such as https://api.deepmap.com/dev-test, and all the + // paths in the swagger spec will be appended to the server. + Server string + + // Doer for performing requests, typically a *http.Client with any + // customized settings, such as certificate chains. + Client HttpRequestDoer + + // A list of callbacks for modifying requests which are generated before sending over + // the network. + RequestEditors []RequestEditorFn +} + +// ClientOption allows setting custom parameters during construction +type ClientOption func(*Client) error + +// Creates a new Client, with reasonable defaults +func NewClient(server string, opts ...ClientOption) (*Client, error) { + // create a client with sane default values + client := Client{ + Server: server, + } + // mutate client and add all optional params + for _, o := range opts { + if err := o(&client); err != nil { + return nil, err + } + } + // ensure the server URL always has a trailing slash + if !strings.HasSuffix(client.Server, "/") { + client.Server += "/" + } + // create httpClient, if not already present + if client.Client == nil { + client.Client = &http.Client{} + } + return &client, nil +} + +// WithHTTPClient allows overriding the default Doer, which is +// automatically created using http.Client. This is useful for tests. +func WithHTTPClient(doer HttpRequestDoer) ClientOption { + return func(c *Client) error { + c.Client = doer + return nil + } +} + +// WithRequestEditorFn allows setting up a callback function, which will be +// called right before sending the request. This can be used to mutate the request. +func WithRequestEditorFn(fn RequestEditorFn) ClientOption { + return func(c *Client) error { + c.RequestEditors = append(c.RequestEditors, fn) + return nil + } +} + +// The interface specification for the client above. +type ClientInterface interface { + // Discovery request + Discovery(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ListClusters request + ListClusters(ctx context.Context, params *ListClustersParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreateClusterWithBody request with any body + CreateClusterWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreateCluster(ctx context.Context, body CreateClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteCluster request + DeleteCluster(ctx context.Context, clusterId ClusterIdParameter, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetCluster request + GetCluster(ctx context.Context, clusterId ClusterIdParameter, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpdateClusterWithBody request with any body + UpdateClusterWithBody(ctx context.Context, clusterId ClusterIdParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + UpdateClusterWithApplicationMergePatchPlusJSONBody(ctx context.Context, clusterId ClusterIdParameter, body UpdateClusterApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PutClusterWithBody request with any body + PutClusterWithBody(ctx context.Context, clusterId ClusterIdParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PutCluster(ctx context.Context, clusterId ClusterIdParameter, body PutClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // Docs request + Docs(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // Healthz request + Healthz(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // InstallSteward request + InstallSteward(ctx context.Context, params *InstallStewardParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // QueryInventory request + QueryInventory(ctx context.Context, params *QueryInventoryParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpdateInventoryWithBody request with any body + UpdateInventoryWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + UpdateInventory(ctx context.Context, body UpdateInventoryJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // Openapi request + Openapi(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ListTenants request + ListTenants(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreateTenantWithBody request with any body + CreateTenantWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreateTenant(ctx context.Context, body CreateTenantJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteTenant request + DeleteTenant(ctx context.Context, tenantId TenantIdParameter, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetTenant request + GetTenant(ctx context.Context, tenantId TenantIdParameter, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpdateTenantWithBody request with any body + UpdateTenantWithBody(ctx context.Context, tenantId TenantIdParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + UpdateTenantWithApplicationMergePatchPlusJSONBody(ctx context.Context, tenantId TenantIdParameter, body UpdateTenantApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PutTenantWithBody request with any body + PutTenantWithBody(ctx context.Context, tenantId TenantIdParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PutTenant(ctx context.Context, tenantId TenantIdParameter, body PutTenantJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) +} + +func (c *Client) Discovery(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDiscoveryRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ListClusters(ctx context.Context, params *ListClustersParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListClustersRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreateClusterWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateClusterRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreateCluster(ctx context.Context, body CreateClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateClusterRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeleteCluster(ctx context.Context, clusterId ClusterIdParameter, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteClusterRequest(c.Server, clusterId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetCluster(ctx context.Context, clusterId ClusterIdParameter, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetClusterRequest(c.Server, clusterId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpdateClusterWithBody(ctx context.Context, clusterId ClusterIdParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateClusterRequestWithBody(c.Server, clusterId, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpdateClusterWithApplicationMergePatchPlusJSONBody(ctx context.Context, clusterId ClusterIdParameter, body UpdateClusterApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateClusterRequestWithApplicationMergePatchPlusJSONBody(c.Server, clusterId, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PutClusterWithBody(ctx context.Context, clusterId ClusterIdParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutClusterRequestWithBody(c.Server, clusterId, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PutCluster(ctx context.Context, clusterId ClusterIdParameter, body PutClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutClusterRequest(c.Server, clusterId, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) Docs(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDocsRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) Healthz(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewHealthzRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) InstallSteward(ctx context.Context, params *InstallStewardParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewInstallStewardRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) QueryInventory(ctx context.Context, params *QueryInventoryParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewQueryInventoryRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpdateInventoryWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateInventoryRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpdateInventory(ctx context.Context, body UpdateInventoryJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateInventoryRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) Openapi(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewOpenapiRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ListTenants(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListTenantsRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreateTenantWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateTenantRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreateTenant(ctx context.Context, body CreateTenantJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateTenantRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeleteTenant(ctx context.Context, tenantId TenantIdParameter, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteTenantRequest(c.Server, tenantId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetTenant(ctx context.Context, tenantId TenantIdParameter, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetTenantRequest(c.Server, tenantId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpdateTenantWithBody(ctx context.Context, tenantId TenantIdParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateTenantRequestWithBody(c.Server, tenantId, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpdateTenantWithApplicationMergePatchPlusJSONBody(ctx context.Context, tenantId TenantIdParameter, body UpdateTenantApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateTenantRequestWithApplicationMergePatchPlusJSONBody(c.Server, tenantId, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PutTenantWithBody(ctx context.Context, tenantId TenantIdParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutTenantRequestWithBody(c.Server, tenantId, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PutTenant(ctx context.Context, tenantId TenantIdParameter, body PutTenantJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutTenantRequest(c.Server, tenantId, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// NewDiscoveryRequest generates requests for Discovery +func NewDiscoveryRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewListClustersRequest generates requests for ListClusters +func NewListClustersRequest(server string, params *ListClustersParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/clusters") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Tenant != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "tenant", runtime.ParamLocationQuery, *params.Tenant); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.SortBy != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sort_by", runtime.ParamLocationQuery, *params.SortBy); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewCreateClusterRequest calls the generic CreateCluster builder with application/json body +func NewCreateClusterRequest(server string, body CreateClusterJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateClusterRequestWithBody(server, "application/json", bodyReader) +} + +// NewCreateClusterRequestWithBody generates requests for CreateCluster with any type of body +func NewCreateClusterRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/clusters") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeleteClusterRequest generates requests for DeleteCluster +func NewDeleteClusterRequest(server string, clusterId ClusterIdParameter) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clusterId", runtime.ParamLocationPath, clusterId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/clusters/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetClusterRequest generates requests for GetCluster +func NewGetClusterRequest(server string, clusterId ClusterIdParameter) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clusterId", runtime.ParamLocationPath, clusterId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/clusters/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewUpdateClusterRequestWithApplicationMergePatchPlusJSONBody calls the generic UpdateCluster builder with application/merge-patch+json body +func NewUpdateClusterRequestWithApplicationMergePatchPlusJSONBody(server string, clusterId ClusterIdParameter, body UpdateClusterApplicationMergePatchPlusJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewUpdateClusterRequestWithBody(server, clusterId, "application/merge-patch+json", bodyReader) +} + +// NewUpdateClusterRequestWithBody generates requests for UpdateCluster with any type of body +func NewUpdateClusterRequestWithBody(server string, clusterId ClusterIdParameter, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clusterId", runtime.ParamLocationPath, clusterId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/clusters/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PATCH", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewPutClusterRequest calls the generic PutCluster builder with application/json body +func NewPutClusterRequest(server string, clusterId ClusterIdParameter, body PutClusterJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPutClusterRequestWithBody(server, clusterId, "application/json", bodyReader) +} + +// NewPutClusterRequestWithBody generates requests for PutCluster with any type of body +func NewPutClusterRequestWithBody(server string, clusterId ClusterIdParameter, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clusterId", runtime.ParamLocationPath, clusterId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/clusters/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PUT", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDocsRequest generates requests for Docs +func NewDocsRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/docs") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewHealthzRequest generates requests for Healthz +func NewHealthzRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/healthz") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewInstallStewardRequest generates requests for InstallSteward +func NewInstallStewardRequest(server string, params *InstallStewardParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/install/steward.json") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Token != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "token", runtime.ParamLocationQuery, *params.Token); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewQueryInventoryRequest generates requests for QueryInventory +func NewQueryInventoryRequest(server string, params *QueryInventoryParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/inventory") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Q != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "q", runtime.ParamLocationQuery, *params.Q); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewUpdateInventoryRequest calls the generic UpdateInventory builder with application/json body +func NewUpdateInventoryRequest(server string, body UpdateInventoryJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewUpdateInventoryRequestWithBody(server, "application/json", bodyReader) +} + +// NewUpdateInventoryRequestWithBody generates requests for UpdateInventory with any type of body +func NewUpdateInventoryRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/inventory") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewOpenapiRequest generates requests for Openapi +func NewOpenapiRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/openapi.json") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewListTenantsRequest generates requests for ListTenants +func NewListTenantsRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/tenants") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewCreateTenantRequest calls the generic CreateTenant builder with application/json body +func NewCreateTenantRequest(server string, body CreateTenantJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateTenantRequestWithBody(server, "application/json", bodyReader) +} + +// NewCreateTenantRequestWithBody generates requests for CreateTenant with any type of body +func NewCreateTenantRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/tenants") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeleteTenantRequest generates requests for DeleteTenant +func NewDeleteTenantRequest(server string, tenantId TenantIdParameter) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "tenantId", runtime.ParamLocationPath, tenantId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/tenants/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetTenantRequest generates requests for GetTenant +func NewGetTenantRequest(server string, tenantId TenantIdParameter) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "tenantId", runtime.ParamLocationPath, tenantId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/tenants/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewUpdateTenantRequestWithApplicationMergePatchPlusJSONBody calls the generic UpdateTenant builder with application/merge-patch+json body +func NewUpdateTenantRequestWithApplicationMergePatchPlusJSONBody(server string, tenantId TenantIdParameter, body UpdateTenantApplicationMergePatchPlusJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewUpdateTenantRequestWithBody(server, tenantId, "application/merge-patch+json", bodyReader) +} + +// NewUpdateTenantRequestWithBody generates requests for UpdateTenant with any type of body +func NewUpdateTenantRequestWithBody(server string, tenantId TenantIdParameter, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "tenantId", runtime.ParamLocationPath, tenantId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/tenants/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PATCH", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewPutTenantRequest calls the generic PutTenant builder with application/json body +func NewPutTenantRequest(server string, tenantId TenantIdParameter, body PutTenantJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPutTenantRequestWithBody(server, tenantId, "application/json", bodyReader) +} + +// NewPutTenantRequestWithBody generates requests for PutTenant with any type of body +func NewPutTenantRequestWithBody(server string, tenantId TenantIdParameter, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "tenantId", runtime.ParamLocationPath, tenantId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/tenants/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PUT", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { + for _, r := range c.RequestEditors { + if err := r(ctx, req); err != nil { + return err + } + } + for _, r := range additionalEditors { + if err := r(ctx, req); err != nil { + return err + } + } + return nil +} + +// ClientWithResponses builds on ClientInterface to offer response payloads +type ClientWithResponses struct { + ClientInterface +} + +// NewClientWithResponses creates a new ClientWithResponses, which wraps +// Client with return type handling +func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { + client, err := NewClient(server, opts...) + if err != nil { + return nil, err + } + return &ClientWithResponses{client}, nil +} + +// WithBaseURL overrides the baseURL. +func WithBaseURL(baseURL string) ClientOption { + return func(c *Client) error { + newBaseURL, err := url.Parse(baseURL) + if err != nil { + return err + } + c.Server = newBaseURL.String() + return nil + } +} + +// ClientWithResponsesInterface is the interface specification for the client with responses above. +type ClientWithResponsesInterface interface { + // DiscoveryWithResponse request + DiscoveryWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*DiscoveryResponse, error) + + // ListClustersWithResponse request + ListClustersWithResponse(ctx context.Context, params *ListClustersParams, reqEditors ...RequestEditorFn) (*ListClustersResponse, error) + + // CreateClusterWithBodyWithResponse request with any body + CreateClusterWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateClusterResponse, error) + + CreateClusterWithResponse(ctx context.Context, body CreateClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateClusterResponse, error) + + // DeleteClusterWithResponse request + DeleteClusterWithResponse(ctx context.Context, clusterId ClusterIdParameter, reqEditors ...RequestEditorFn) (*DeleteClusterResponse, error) + + // GetClusterWithResponse request + GetClusterWithResponse(ctx context.Context, clusterId ClusterIdParameter, reqEditors ...RequestEditorFn) (*GetClusterResponse, error) + + // UpdateClusterWithBodyWithResponse request with any body + UpdateClusterWithBodyWithResponse(ctx context.Context, clusterId ClusterIdParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateClusterResponse, error) + + UpdateClusterWithApplicationMergePatchPlusJSONBodyWithResponse(ctx context.Context, clusterId ClusterIdParameter, body UpdateClusterApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateClusterResponse, error) + + // PutClusterWithBodyWithResponse request with any body + PutClusterWithBodyWithResponse(ctx context.Context, clusterId ClusterIdParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutClusterResponse, error) + + PutClusterWithResponse(ctx context.Context, clusterId ClusterIdParameter, body PutClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*PutClusterResponse, error) + + // DocsWithResponse request + DocsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*DocsResponse, error) + + // HealthzWithResponse request + HealthzWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*HealthzResponse, error) + + // InstallStewardWithResponse request + InstallStewardWithResponse(ctx context.Context, params *InstallStewardParams, reqEditors ...RequestEditorFn) (*InstallStewardResponse, error) + + // QueryInventoryWithResponse request + QueryInventoryWithResponse(ctx context.Context, params *QueryInventoryParams, reqEditors ...RequestEditorFn) (*QueryInventoryResponse, error) + + // UpdateInventoryWithBodyWithResponse request with any body + UpdateInventoryWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateInventoryResponse, error) + + UpdateInventoryWithResponse(ctx context.Context, body UpdateInventoryJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateInventoryResponse, error) + + // OpenapiWithResponse request + OpenapiWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*OpenapiResponse, error) + + // ListTenantsWithResponse request + ListTenantsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListTenantsResponse, error) + + // CreateTenantWithBodyWithResponse request with any body + CreateTenantWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTenantResponse, error) + + CreateTenantWithResponse(ctx context.Context, body CreateTenantJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTenantResponse, error) + + // DeleteTenantWithResponse request + DeleteTenantWithResponse(ctx context.Context, tenantId TenantIdParameter, reqEditors ...RequestEditorFn) (*DeleteTenantResponse, error) + + // GetTenantWithResponse request + GetTenantWithResponse(ctx context.Context, tenantId TenantIdParameter, reqEditors ...RequestEditorFn) (*GetTenantResponse, error) + + // UpdateTenantWithBodyWithResponse request with any body + UpdateTenantWithBodyWithResponse(ctx context.Context, tenantId TenantIdParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateTenantResponse, error) + + UpdateTenantWithApplicationMergePatchPlusJSONBodyWithResponse(ctx context.Context, tenantId TenantIdParameter, body UpdateTenantApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateTenantResponse, error) + + // PutTenantWithBodyWithResponse request with any body + PutTenantWithBodyWithResponse(ctx context.Context, tenantId TenantIdParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutTenantResponse, error) + + PutTenantWithResponse(ctx context.Context, tenantId TenantIdParameter, body PutTenantJSONRequestBody, reqEditors ...RequestEditorFn) (*PutTenantResponse, error) +} + +type DiscoveryResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Metadata + JSONDefault *Default +} + +// Status returns HTTPResponse.Status +func (r DiscoveryResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DiscoveryResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ListClustersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *[]Cluster + JSONDefault *Default +} + +// Status returns HTTPResponse.Status +func (r ListClustersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListClustersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateClusterResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *Cluster + JSON400 *Reason + JSONDefault *Default +} + +// Status returns HTTPResponse.Status +func (r CreateClusterResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateClusterResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteClusterResponse struct { + Body []byte + HTTPResponse *http.Response + JSON403 *Reason + JSONDefault *Default +} + +// Status returns HTTPResponse.Status +func (r DeleteClusterResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteClusterResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetClusterResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Cluster + JSONDefault *Default +} + +// Status returns HTTPResponse.Status +func (r GetClusterResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetClusterResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdateClusterResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Cluster + JSON403 *Reason + JSONDefault *Default +} + +// Status returns HTTPResponse.Status +func (r UpdateClusterResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdateClusterResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PutClusterResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Cluster + JSON201 *Cluster + JSON403 *Reason + JSONDefault *Default +} + +// Status returns HTTPResponse.Status +func (r PutClusterResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PutClusterResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DocsResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r DocsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DocsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type HealthzResponse struct { + Body []byte + HTTPResponse *http.Response + JSONDefault *Default +} + +// Status returns HTTPResponse.Status +func (r HealthzResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r HealthzResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type InstallStewardResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *map[string]interface{} + JSONDefault *Default +} + +// Status returns HTTPResponse.Status +func (r InstallStewardResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r InstallStewardResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type QueryInventoryResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Inventory + JSONDefault *Default +} + +// Status returns HTTPResponse.Status +func (r QueryInventoryResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r QueryInventoryResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdateInventoryResponse struct { + Body []byte + HTTPResponse *http.Response + JSONDefault *Default +} + +// Status returns HTTPResponse.Status +func (r UpdateInventoryResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdateInventoryResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type OpenapiResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *map[string]interface{} +} + +// Status returns HTTPResponse.Status +func (r OpenapiResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r OpenapiResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ListTenantsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *[]Tenant + JSONDefault *Default +} + +// Status returns HTTPResponse.Status +func (r ListTenantsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListTenantsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateTenantResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *Tenant + JSON400 *Reason + JSONDefault *Default +} + +// Status returns HTTPResponse.Status +func (r CreateTenantResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateTenantResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteTenantResponse struct { + Body []byte + HTTPResponse *http.Response + JSON403 *Reason + JSONDefault *Default +} + +// Status returns HTTPResponse.Status +func (r DeleteTenantResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteTenantResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetTenantResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Tenant + JSONDefault *Default +} + +// Status returns HTTPResponse.Status +func (r GetTenantResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetTenantResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdateTenantResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Tenant + JSON403 *Reason + JSONDefault *Default +} + +// Status returns HTTPResponse.Status +func (r UpdateTenantResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdateTenantResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PutTenantResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Tenant + JSON201 *Tenant + JSON403 *Reason + JSONDefault *Default +} + +// Status returns HTTPResponse.Status +func (r PutTenantResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PutTenantResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// DiscoveryWithResponse request returning *DiscoveryResponse +func (c *ClientWithResponses) DiscoveryWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*DiscoveryResponse, error) { + rsp, err := c.Discovery(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseDiscoveryResponse(rsp) +} + +// ListClustersWithResponse request returning *ListClustersResponse +func (c *ClientWithResponses) ListClustersWithResponse(ctx context.Context, params *ListClustersParams, reqEditors ...RequestEditorFn) (*ListClustersResponse, error) { + rsp, err := c.ListClusters(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListClustersResponse(rsp) +} + +// CreateClusterWithBodyWithResponse request with arbitrary body returning *CreateClusterResponse +func (c *ClientWithResponses) CreateClusterWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateClusterResponse, error) { + rsp, err := c.CreateClusterWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateClusterResponse(rsp) +} + +func (c *ClientWithResponses) CreateClusterWithResponse(ctx context.Context, body CreateClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateClusterResponse, error) { + rsp, err := c.CreateCluster(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateClusterResponse(rsp) +} + +// DeleteClusterWithResponse request returning *DeleteClusterResponse +func (c *ClientWithResponses) DeleteClusterWithResponse(ctx context.Context, clusterId ClusterIdParameter, reqEditors ...RequestEditorFn) (*DeleteClusterResponse, error) { + rsp, err := c.DeleteCluster(ctx, clusterId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteClusterResponse(rsp) +} + +// GetClusterWithResponse request returning *GetClusterResponse +func (c *ClientWithResponses) GetClusterWithResponse(ctx context.Context, clusterId ClusterIdParameter, reqEditors ...RequestEditorFn) (*GetClusterResponse, error) { + rsp, err := c.GetCluster(ctx, clusterId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetClusterResponse(rsp) +} + +// UpdateClusterWithBodyWithResponse request with arbitrary body returning *UpdateClusterResponse +func (c *ClientWithResponses) UpdateClusterWithBodyWithResponse(ctx context.Context, clusterId ClusterIdParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateClusterResponse, error) { + rsp, err := c.UpdateClusterWithBody(ctx, clusterId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateClusterResponse(rsp) +} + +func (c *ClientWithResponses) UpdateClusterWithApplicationMergePatchPlusJSONBodyWithResponse(ctx context.Context, clusterId ClusterIdParameter, body UpdateClusterApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateClusterResponse, error) { + rsp, err := c.UpdateClusterWithApplicationMergePatchPlusJSONBody(ctx, clusterId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateClusterResponse(rsp) +} + +// PutClusterWithBodyWithResponse request with arbitrary body returning *PutClusterResponse +func (c *ClientWithResponses) PutClusterWithBodyWithResponse(ctx context.Context, clusterId ClusterIdParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutClusterResponse, error) { + rsp, err := c.PutClusterWithBody(ctx, clusterId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePutClusterResponse(rsp) +} + +func (c *ClientWithResponses) PutClusterWithResponse(ctx context.Context, clusterId ClusterIdParameter, body PutClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*PutClusterResponse, error) { + rsp, err := c.PutCluster(ctx, clusterId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePutClusterResponse(rsp) +} + +// DocsWithResponse request returning *DocsResponse +func (c *ClientWithResponses) DocsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*DocsResponse, error) { + rsp, err := c.Docs(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseDocsResponse(rsp) +} + +// HealthzWithResponse request returning *HealthzResponse +func (c *ClientWithResponses) HealthzWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*HealthzResponse, error) { + rsp, err := c.Healthz(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseHealthzResponse(rsp) +} + +// InstallStewardWithResponse request returning *InstallStewardResponse +func (c *ClientWithResponses) InstallStewardWithResponse(ctx context.Context, params *InstallStewardParams, reqEditors ...RequestEditorFn) (*InstallStewardResponse, error) { + rsp, err := c.InstallSteward(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseInstallStewardResponse(rsp) +} + +// QueryInventoryWithResponse request returning *QueryInventoryResponse +func (c *ClientWithResponses) QueryInventoryWithResponse(ctx context.Context, params *QueryInventoryParams, reqEditors ...RequestEditorFn) (*QueryInventoryResponse, error) { + rsp, err := c.QueryInventory(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseQueryInventoryResponse(rsp) +} + +// UpdateInventoryWithBodyWithResponse request with arbitrary body returning *UpdateInventoryResponse +func (c *ClientWithResponses) UpdateInventoryWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateInventoryResponse, error) { + rsp, err := c.UpdateInventoryWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateInventoryResponse(rsp) +} + +func (c *ClientWithResponses) UpdateInventoryWithResponse(ctx context.Context, body UpdateInventoryJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateInventoryResponse, error) { + rsp, err := c.UpdateInventory(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateInventoryResponse(rsp) +} + +// OpenapiWithResponse request returning *OpenapiResponse +func (c *ClientWithResponses) OpenapiWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*OpenapiResponse, error) { + rsp, err := c.Openapi(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseOpenapiResponse(rsp) +} + +// ListTenantsWithResponse request returning *ListTenantsResponse +func (c *ClientWithResponses) ListTenantsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListTenantsResponse, error) { + rsp, err := c.ListTenants(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseListTenantsResponse(rsp) +} + +// CreateTenantWithBodyWithResponse request with arbitrary body returning *CreateTenantResponse +func (c *ClientWithResponses) CreateTenantWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTenantResponse, error) { + rsp, err := c.CreateTenantWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateTenantResponse(rsp) +} + +func (c *ClientWithResponses) CreateTenantWithResponse(ctx context.Context, body CreateTenantJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTenantResponse, error) { + rsp, err := c.CreateTenant(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateTenantResponse(rsp) +} + +// DeleteTenantWithResponse request returning *DeleteTenantResponse +func (c *ClientWithResponses) DeleteTenantWithResponse(ctx context.Context, tenantId TenantIdParameter, reqEditors ...RequestEditorFn) (*DeleteTenantResponse, error) { + rsp, err := c.DeleteTenant(ctx, tenantId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteTenantResponse(rsp) +} + +// GetTenantWithResponse request returning *GetTenantResponse +func (c *ClientWithResponses) GetTenantWithResponse(ctx context.Context, tenantId TenantIdParameter, reqEditors ...RequestEditorFn) (*GetTenantResponse, error) { + rsp, err := c.GetTenant(ctx, tenantId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetTenantResponse(rsp) +} + +// UpdateTenantWithBodyWithResponse request with arbitrary body returning *UpdateTenantResponse +func (c *ClientWithResponses) UpdateTenantWithBodyWithResponse(ctx context.Context, tenantId TenantIdParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateTenantResponse, error) { + rsp, err := c.UpdateTenantWithBody(ctx, tenantId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateTenantResponse(rsp) +} + +func (c *ClientWithResponses) UpdateTenantWithApplicationMergePatchPlusJSONBodyWithResponse(ctx context.Context, tenantId TenantIdParameter, body UpdateTenantApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateTenantResponse, error) { + rsp, err := c.UpdateTenantWithApplicationMergePatchPlusJSONBody(ctx, tenantId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateTenantResponse(rsp) +} + +// PutTenantWithBodyWithResponse request with arbitrary body returning *PutTenantResponse +func (c *ClientWithResponses) PutTenantWithBodyWithResponse(ctx context.Context, tenantId TenantIdParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutTenantResponse, error) { + rsp, err := c.PutTenantWithBody(ctx, tenantId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePutTenantResponse(rsp) +} + +func (c *ClientWithResponses) PutTenantWithResponse(ctx context.Context, tenantId TenantIdParameter, body PutTenantJSONRequestBody, reqEditors ...RequestEditorFn) (*PutTenantResponse, error) { + rsp, err := c.PutTenant(ctx, tenantId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePutTenantResponse(rsp) +} + +// ParseDiscoveryResponse parses an HTTP response from a DiscoveryWithResponse call +func ParseDiscoveryResponse(rsp *http.Response) (*DiscoveryResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DiscoveryResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Metadata + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Default + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseListClustersResponse parses an HTTP response from a ListClustersWithResponse call +func ParseListClustersResponse(rsp *http.Response) (*ListClustersResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ListClustersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest []Cluster + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Default + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseCreateClusterResponse parses an HTTP response from a CreateClusterWithResponse call +func ParseCreateClusterResponse(rsp *http.Response) (*CreateClusterResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &CreateClusterResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest Cluster + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Reason + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Default + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteClusterResponse parses an HTTP response from a DeleteClusterWithResponse call +func ParseDeleteClusterResponse(rsp *http.Response) (*DeleteClusterResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteClusterResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Reason + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Default + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetClusterResponse parses an HTTP response from a GetClusterWithResponse call +func ParseGetClusterResponse(rsp *http.Response) (*GetClusterResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetClusterResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Cluster + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Default + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseUpdateClusterResponse parses an HTTP response from a UpdateClusterWithResponse call +func ParseUpdateClusterResponse(rsp *http.Response) (*UpdateClusterResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &UpdateClusterResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Cluster + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Reason + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Default + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePutClusterResponse parses an HTTP response from a PutClusterWithResponse call +func ParsePutClusterResponse(rsp *http.Response) (*PutClusterResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PutClusterResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Cluster + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest Cluster + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Reason + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Default + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDocsResponse parses an HTTP response from a DocsWithResponse call +func ParseDocsResponse(rsp *http.Response) (*DocsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DocsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseHealthzResponse parses an HTTP response from a HealthzWithResponse call +func ParseHealthzResponse(rsp *http.Response) (*HealthzResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &HealthzResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Default + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseInstallStewardResponse parses an HTTP response from a InstallStewardWithResponse call +func ParseInstallStewardResponse(rsp *http.Response) (*InstallStewardResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &InstallStewardResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest map[string]interface{} + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Default + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseQueryInventoryResponse parses an HTTP response from a QueryInventoryWithResponse call +func ParseQueryInventoryResponse(rsp *http.Response) (*QueryInventoryResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &QueryInventoryResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Inventory + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Default + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseUpdateInventoryResponse parses an HTTP response from a UpdateInventoryWithResponse call +func ParseUpdateInventoryResponse(rsp *http.Response) (*UpdateInventoryResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &UpdateInventoryResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Default + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseOpenapiResponse parses an HTTP response from a OpenapiWithResponse call +func ParseOpenapiResponse(rsp *http.Response) (*OpenapiResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &OpenapiResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest map[string]interface{} + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseListTenantsResponse parses an HTTP response from a ListTenantsWithResponse call +func ParseListTenantsResponse(rsp *http.Response) (*ListTenantsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ListTenantsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest []Tenant + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Default + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseCreateTenantResponse parses an HTTP response from a CreateTenantWithResponse call +func ParseCreateTenantResponse(rsp *http.Response) (*CreateTenantResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &CreateTenantResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest Tenant + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Reason + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Default + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteTenantResponse parses an HTTP response from a DeleteTenantWithResponse call +func ParseDeleteTenantResponse(rsp *http.Response) (*DeleteTenantResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteTenantResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Reason + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Default + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetTenantResponse parses an HTTP response from a GetTenantWithResponse call +func ParseGetTenantResponse(rsp *http.Response) (*GetTenantResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetTenantResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Tenant + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Default + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseUpdateTenantResponse parses an HTTP response from a UpdateTenantWithResponse call +func ParseUpdateTenantResponse(rsp *http.Response) (*UpdateTenantResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &UpdateTenantResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Tenant + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Reason + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Default + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePutTenantResponse parses an HTTP response from a PutTenantWithResponse call +func ParsePutTenantResponse(rsp *http.Response) (*PutTenantResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PutTenantResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Tenant + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest Tenant + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Reason + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Default + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} // ServerInterface represents all server handlers. type ServerInterface interface { @@ -305,7 +2932,7 @@ type ServerInterfaceWrapper struct { func (w *ServerInterfaceWrapper) Discovery(ctx echo.Context) error { var err error - // Invoke the callback with all the unmarshalled arguments + // Invoke the callback with all the unmarshaled arguments err = w.Handler.Discovery(ctx) return err } @@ -314,7 +2941,7 @@ func (w *ServerInterfaceWrapper) Discovery(ctx echo.Context) error { func (w *ServerInterfaceWrapper) ListClusters(ctx echo.Context) error { var err error - ctx.Set(BearerAuthScopes, []string{""}) + ctx.Set(BearerAuthScopes, []string{}) // Parameter object where we will unmarshal all parameters from the context var params ListClustersParams @@ -332,7 +2959,7 @@ func (w *ServerInterfaceWrapper) ListClusters(ctx echo.Context) error { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter sort_by: %s", err)) } - // Invoke the callback with all the unmarshalled arguments + // Invoke the callback with all the unmarshaled arguments err = w.Handler.ListClusters(ctx, params) return err } @@ -341,9 +2968,9 @@ func (w *ServerInterfaceWrapper) ListClusters(ctx echo.Context) error { func (w *ServerInterfaceWrapper) CreateCluster(ctx echo.Context) error { var err error - ctx.Set(BearerAuthScopes, []string{""}) + ctx.Set(BearerAuthScopes, []string{}) - // Invoke the callback with all the unmarshalled arguments + // Invoke the callback with all the unmarshaled arguments err = w.Handler.CreateCluster(ctx) return err } @@ -354,14 +2981,14 @@ func (w *ServerInterfaceWrapper) DeleteCluster(ctx echo.Context) error { // ------------- Path parameter "clusterId" ------------- var clusterId ClusterIdParameter - err = runtime.BindStyledParameterWithLocation("simple", false, "clusterId", runtime.ParamLocationPath, ctx.Param("clusterId"), &clusterId) + err = runtime.BindStyledParameterWithOptions("simple", "clusterId", ctx.Param("clusterId"), &clusterId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter clusterId: %s", err)) } - ctx.Set(BearerAuthScopes, []string{""}) + ctx.Set(BearerAuthScopes, []string{}) - // Invoke the callback with all the unmarshalled arguments + // Invoke the callback with all the unmarshaled arguments err = w.Handler.DeleteCluster(ctx, clusterId) return err } @@ -372,14 +2999,14 @@ func (w *ServerInterfaceWrapper) GetCluster(ctx echo.Context) error { // ------------- Path parameter "clusterId" ------------- var clusterId ClusterIdParameter - err = runtime.BindStyledParameterWithLocation("simple", false, "clusterId", runtime.ParamLocationPath, ctx.Param("clusterId"), &clusterId) + err = runtime.BindStyledParameterWithOptions("simple", "clusterId", ctx.Param("clusterId"), &clusterId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter clusterId: %s", err)) } - ctx.Set(BearerAuthScopes, []string{""}) + ctx.Set(BearerAuthScopes, []string{}) - // Invoke the callback with all the unmarshalled arguments + // Invoke the callback with all the unmarshaled arguments err = w.Handler.GetCluster(ctx, clusterId) return err } @@ -390,14 +3017,14 @@ func (w *ServerInterfaceWrapper) UpdateCluster(ctx echo.Context) error { // ------------- Path parameter "clusterId" ------------- var clusterId ClusterIdParameter - err = runtime.BindStyledParameterWithLocation("simple", false, "clusterId", runtime.ParamLocationPath, ctx.Param("clusterId"), &clusterId) + err = runtime.BindStyledParameterWithOptions("simple", "clusterId", ctx.Param("clusterId"), &clusterId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter clusterId: %s", err)) } - ctx.Set(BearerAuthScopes, []string{""}) + ctx.Set(BearerAuthScopes, []string{}) - // Invoke the callback with all the unmarshalled arguments + // Invoke the callback with all the unmarshaled arguments err = w.Handler.UpdateCluster(ctx, clusterId) return err } @@ -408,14 +3035,14 @@ func (w *ServerInterfaceWrapper) PutCluster(ctx echo.Context) error { // ------------- Path parameter "clusterId" ------------- var clusterId ClusterIdParameter - err = runtime.BindStyledParameterWithLocation("simple", false, "clusterId", runtime.ParamLocationPath, ctx.Param("clusterId"), &clusterId) + err = runtime.BindStyledParameterWithOptions("simple", "clusterId", ctx.Param("clusterId"), &clusterId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter clusterId: %s", err)) } - ctx.Set(BearerAuthScopes, []string{""}) + ctx.Set(BearerAuthScopes, []string{}) - // Invoke the callback with all the unmarshalled arguments + // Invoke the callback with all the unmarshaled arguments err = w.Handler.PutCluster(ctx, clusterId) return err } @@ -424,7 +3051,7 @@ func (w *ServerInterfaceWrapper) PutCluster(ctx echo.Context) error { func (w *ServerInterfaceWrapper) Docs(ctx echo.Context) error { var err error - // Invoke the callback with all the unmarshalled arguments + // Invoke the callback with all the unmarshaled arguments err = w.Handler.Docs(ctx) return err } @@ -433,7 +3060,7 @@ func (w *ServerInterfaceWrapper) Docs(ctx echo.Context) error { func (w *ServerInterfaceWrapper) Healthz(ctx echo.Context) error { var err error - // Invoke the callback with all the unmarshalled arguments + // Invoke the callback with all the unmarshaled arguments err = w.Handler.Healthz(ctx) return err } @@ -451,7 +3078,7 @@ func (w *ServerInterfaceWrapper) InstallSteward(ctx echo.Context) error { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter token: %s", err)) } - // Invoke the callback with all the unmarshalled arguments + // Invoke the callback with all the unmarshaled arguments err = w.Handler.InstallSteward(ctx, params) return err } @@ -460,7 +3087,7 @@ func (w *ServerInterfaceWrapper) InstallSteward(ctx echo.Context) error { func (w *ServerInterfaceWrapper) QueryInventory(ctx echo.Context) error { var err error - ctx.Set(BearerAuthScopes, []string{""}) + ctx.Set(BearerAuthScopes, []string{}) // Parameter object where we will unmarshal all parameters from the context var params QueryInventoryParams @@ -471,7 +3098,7 @@ func (w *ServerInterfaceWrapper) QueryInventory(ctx echo.Context) error { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter q: %s", err)) } - // Invoke the callback with all the unmarshalled arguments + // Invoke the callback with all the unmarshaled arguments err = w.Handler.QueryInventory(ctx, params) return err } @@ -480,9 +3107,9 @@ func (w *ServerInterfaceWrapper) QueryInventory(ctx echo.Context) error { func (w *ServerInterfaceWrapper) UpdateInventory(ctx echo.Context) error { var err error - ctx.Set(BearerAuthScopes, []string{""}) + ctx.Set(BearerAuthScopes, []string{}) - // Invoke the callback with all the unmarshalled arguments + // Invoke the callback with all the unmarshaled arguments err = w.Handler.UpdateInventory(ctx) return err } @@ -491,7 +3118,7 @@ func (w *ServerInterfaceWrapper) UpdateInventory(ctx echo.Context) error { func (w *ServerInterfaceWrapper) Openapi(ctx echo.Context) error { var err error - // Invoke the callback with all the unmarshalled arguments + // Invoke the callback with all the unmarshaled arguments err = w.Handler.Openapi(ctx) return err } @@ -500,9 +3127,9 @@ func (w *ServerInterfaceWrapper) Openapi(ctx echo.Context) error { func (w *ServerInterfaceWrapper) ListTenants(ctx echo.Context) error { var err error - ctx.Set(BearerAuthScopes, []string{""}) + ctx.Set(BearerAuthScopes, []string{}) - // Invoke the callback with all the unmarshalled arguments + // Invoke the callback with all the unmarshaled arguments err = w.Handler.ListTenants(ctx) return err } @@ -511,9 +3138,9 @@ func (w *ServerInterfaceWrapper) ListTenants(ctx echo.Context) error { func (w *ServerInterfaceWrapper) CreateTenant(ctx echo.Context) error { var err error - ctx.Set(BearerAuthScopes, []string{""}) + ctx.Set(BearerAuthScopes, []string{}) - // Invoke the callback with all the unmarshalled arguments + // Invoke the callback with all the unmarshaled arguments err = w.Handler.CreateTenant(ctx) return err } @@ -524,14 +3151,14 @@ func (w *ServerInterfaceWrapper) DeleteTenant(ctx echo.Context) error { // ------------- Path parameter "tenantId" ------------- var tenantId TenantIdParameter - err = runtime.BindStyledParameterWithLocation("simple", false, "tenantId", runtime.ParamLocationPath, ctx.Param("tenantId"), &tenantId) + err = runtime.BindStyledParameterWithOptions("simple", "tenantId", ctx.Param("tenantId"), &tenantId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter tenantId: %s", err)) } - ctx.Set(BearerAuthScopes, []string{""}) + ctx.Set(BearerAuthScopes, []string{}) - // Invoke the callback with all the unmarshalled arguments + // Invoke the callback with all the unmarshaled arguments err = w.Handler.DeleteTenant(ctx, tenantId) return err } @@ -542,14 +3169,14 @@ func (w *ServerInterfaceWrapper) GetTenant(ctx echo.Context) error { // ------------- Path parameter "tenantId" ------------- var tenantId TenantIdParameter - err = runtime.BindStyledParameterWithLocation("simple", false, "tenantId", runtime.ParamLocationPath, ctx.Param("tenantId"), &tenantId) + err = runtime.BindStyledParameterWithOptions("simple", "tenantId", ctx.Param("tenantId"), &tenantId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter tenantId: %s", err)) } - ctx.Set(BearerAuthScopes, []string{""}) + ctx.Set(BearerAuthScopes, []string{}) - // Invoke the callback with all the unmarshalled arguments + // Invoke the callback with all the unmarshaled arguments err = w.Handler.GetTenant(ctx, tenantId) return err } @@ -560,14 +3187,14 @@ func (w *ServerInterfaceWrapper) UpdateTenant(ctx echo.Context) error { // ------------- Path parameter "tenantId" ------------- var tenantId TenantIdParameter - err = runtime.BindStyledParameterWithLocation("simple", false, "tenantId", runtime.ParamLocationPath, ctx.Param("tenantId"), &tenantId) + err = runtime.BindStyledParameterWithOptions("simple", "tenantId", ctx.Param("tenantId"), &tenantId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter tenantId: %s", err)) } - ctx.Set(BearerAuthScopes, []string{""}) + ctx.Set(BearerAuthScopes, []string{}) - // Invoke the callback with all the unmarshalled arguments + // Invoke the callback with all the unmarshaled arguments err = w.Handler.UpdateTenant(ctx, tenantId) return err } @@ -578,14 +3205,14 @@ func (w *ServerInterfaceWrapper) PutTenant(ctx echo.Context) error { // ------------- Path parameter "tenantId" ------------- var tenantId TenantIdParameter - err = runtime.BindStyledParameterWithLocation("simple", false, "tenantId", runtime.ParamLocationPath, ctx.Param("tenantId"), &tenantId) + err = runtime.BindStyledParameterWithOptions("simple", "tenantId", ctx.Param("tenantId"), &tenantId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter tenantId: %s", err)) } - ctx.Set(BearerAuthScopes, []string{""}) + ctx.Set(BearerAuthScopes, []string{}) - // Invoke the callback with all the unmarshalled arguments + // Invoke the callback with all the unmarshaled arguments err = w.Handler.PutTenant(ctx, tenantId) return err } @@ -651,67 +3278,67 @@ var swaggerSpec = []string{ "HpgwwkYIiwFRAospCkHhACvs1Ty4w2FEQcMMOSOKC8JGDTllDcU5lU1JsbftrXear9EZYF+RCXg1L3tv", "BaElUteioSBlPeIsqLfW2x3voeapaaQFxgfX4Cv9wOmq4SylJ0Nv+8tiLqbK7T3UVjpp9W3V06eCRyAU", "Aek9XGb0vcW+qmC1eYzwgMcK4cSAkL1dA/W0iHxM6VQzfkhGiUSaViIRJkI2imz3KY8Db9vDt9KreQGR", - "SpBB7NDxCJgck6HqGE0f2acQ129BqnprEYO7gfET2e22v3skWNFkM6P6oj+6nI/mtIBgVssTBgUwJPph", - "wqmvrD8GdEC0/kdcar2bIiJRLGPDvRAzPIIADabGF+ycdhFmAcKx4iNgILCCwAGRcrwPEeXTdzBFt4RS", - "NID89z0Ft1hoT1HkBS5a1CKm5I3vwcgoonh6bFxRhSfTL5F+O+Nn83L33k/RBPSlw4gLhZnKnXK81prA", - "RgbjlOGQ+KlOLiJ2354tqPFDzRuu8u3sRyOiziDiyz47cMf0F5QPMHUPzmBCJLEes8glK3n7FimO4sQB", - "anZZGM6CRGwYj0YFXTGyJxIpfAMSRQJ8CID5gPgEhAGSQs8ZosY1BtRPI0smjkmrsd5oV/GeMKkwpedn", - "RxWO9+xIUz8E5Y+RO6h1jwxBKomGXCTql1oCHgFTDWSoN9rKGZ1qlZWgECnoywuJFL8Bpg1DKn12gikJ", - "ioSPlYrkdrOJI2Lc9kSOWYOBajpymtIS0NCh638MvH9/jdfW2r4EX4Dq6yfmARgXg4MTRqdJMC1xw/r7", - "X5OvhfH3kO8CB+rCSMmJqvR58c7dmdQFKX2DRO4DoJyNtEQLdIUxVcTnIqokLe+GHdoqV1xl8mXHZA+h", - "4cIItiMARSAID1wci4NIO1vtSU8F14dQb8qMN5ZjHtMAMa4S/Q0xM/57JsTdxAMQDBTICxCJwgxiQoN9", - "rPRV1tfWW/W1Tr212W9tba91tjudv7yaSXkJ1bmCN/I94472eBgSnW/8Eax12ut/rHfw1jDY6rzuDDZf", - "t9p/DF5vttf8dnu4/sdG0G6vD+1nfQGgg7PNawEz+zglx+jHWmPzXzdt2dLvePZqxFuN1kajtebVvBBf", - "c02OPhMSZv69rl9EFKshF6G37VHC4rsmDoPNTrV+HWRetSiiPafK1iKK0bGWxsY0AOaiYym6BUlILGPp", - "9Q5RFA8o8U2u2ET2rPlDeyynEn6BGB8rTPlohijnxxxqE8HLkbdoiFKO6xCsb2y0ttDOzs7OXvv4Hu+1", - "6F/73dZx/82GftbdP9jCGx9vj+Jb/+792TQ4/tbt8GF8/yn2xe676OBkcnqxdXrSGcXXX1mV0x5zqd7B", - "VFbf/obxW4b0GZmYrHY/EoT2Li+NTVLCAEVcSjKgYPhiHkcUNKPkq8KlRkRRPGj4PEQr3W9nGO8dvrvo", - "X3+L7yZqc+/9pgoOOr2jqLWrWJOdwOHhm43zk/uzYPiV5YCDH0hcl2O8XmdEqmh9Y9MgebN+cf3X4fH4", - "6NMx/9zvqkFI74PDnelx/7PBV/x7d3f3be/9t/s/4WJLnN+fd24+EnVwDWed0489vL7VO/32Z2t4cTNW", - "1+3D262766OLTxefxfnWB/r5ozg5+rQbfdh89/F6cN3f7wf7N5yP396PBm8+/7taGPZBSRAR+GRIQOqo", - "h41SJR6lmMAl4tGljOCUgmigHVfi8CF6ETN3+AUKATOJiHohjVcKMcvByL4vyE7nlFVUx4JWpP8xpUhH", - "/ZzaaMpnVXy72RwR9Z8RUePYiK6J/RC0n9fPeSTr4TSpvkdErRaXbEY/m2LHjHzTnDDHEAmAKc1WgSyo", - "BtqJFQ/TuqTKe+jA6Quwlv6S2CiqvRn66tlcgYJSIGyaULePcKARkgkUnjIes8KDgIyIkvbRVw/djkEA", - "0mmSBSkRFoAovwXhYwk1FOI7tNlG/hgL7JsDmh6uMH3VMOq1NEXpsgkw7Z0qQnTyCunyVwsR59Luogf1", - "szq1IifMoZiR00zYTsBUxe33SR1eyjFwRHKhsoSfk8BflpSfdPf3bEAp0ZSDXkVW7ssSYT4lYBovVWQF", - "RPo6QZueW9vRKoR1sI4FqSsIdZCEpYlOAUotw1hFquuwVJiF7aMYx531eGZlLOZ83jcJpgEQgpR4BAUD", - "3wUf64yWD90pufRSDlP1HbIsepa8efn1WVVujWeT6NXcSgILglxislprJiv8ljXC3EVMhyVLrFfDkvQP", - "l6KxB2cbOunnT9oOKeGu0ElXFwQwJOwp2iE7lKLshgjufIgUYjgE42W5oQTTvLtvPHdfhOX6Iq6kyZvW", - "jh8C2uMialTF5BX7EWWNfsbOxIpthQI5lc2FUq6RR57k5T+fgFhwq2YfDzVPgh8LoqY9zWWrK7uABYid", - "WI1NRWf+eps4/T8/9j3Xw9aQ7NsM11ipyLbGCRvypOeOfeMYIMSEetvm1X9MS8PPdf8veofHaOfAc0la", - "2gNJDpba7fnK9b2xpRCYcoUTJT4waVTWwd/t7aN2fY8aJ3/kXs8i88ecS8Dua8Ni92/ZHMig3q77BkDT", - "pMBEGckcEYidF7DIJ1kFutbYaKyZ6B4BwxHxtr12Y62xri0Uq7FheFP/ZwQV3YcDXX67fMJV9xkyzwC1", - "KqMdobZGG2O9mRHI+trao40/0vSmYgCSY0Q6jTCH0glMFeSU1GYyqskrprf95bLmyTgMsc7MZpiNzjg3", - "qo5HUvtxOZUKQu9SQ2i6LE3OZe8RkUobYnIQ4QkmFOva0OXLVp5FNuuv9hLQtcLQ7kvJ3AlVIDIE2tdb", - "4klQLFjgnvPNZC72LbZSLAzGvPwYrGTbpUqMC4WovuBgioYEaBGfQV+FS3Kh/ncwLSBLBWg/AxaHLmjW", - "MtrygeKy7Hwuf1EniYJw1VZ3boKChcDTKl11Rw2LTEX1JozUFJnzunhl3EkqpxWNn9fmVH/PQMWCSYSt", - "cHLal1PjtL54qHkRlxWqu6dDPeR6fZnCusSju6+TjcrKsFANXvk/X/td2dLvK9O1n4Z4y0Xwg9VfVyF/", - "DP6NTBrlzkDgjkgl0QCGXIBLbdjInLDxq4a4GoO4JRLQEBMqLbDkxtIcvXJyvkpqaZ1iESXRlb2Ni9W9", - "CPzkSvrE1YBzJZXAkWmlX9nOhJnyFZ2BlcNeWm7qpBKk2uXB9NFcbqrVFVqcqAGDW1SkIhufP5RMr/Us", - "tDnNNKIDneh7nUcMRPPn8ClizF6YLnaBgo0KY0rGOFQADqZO9R7B2K14pJNPbhZYsvN8vGp+T7c0Hiyx", - "FFRV9m2ey0K7YyYjMCcyvZiJVVVXyo40KxZQKtx4Zz4/LeGO7+1nlLxBTGynYECCANgjCLOK3VUOuzLV", - "SN2+HfjFIGcbVUXJHYB6WrGtPacLGPKYOTXoLNooSGsy6frIASIBusVSG7IB8qgheK4sKuMwVv64Yloc", - "BXixEdoTjy7NVeJMCGIEdUP5v35KqPm2S1m89mZF6eVaFYob5zu2DfuXZ2/30Ov21uarFQLUs2pnbK7x", - "G9yURfyoTqpKHSu1OVbzdZknQXuRWp/G6rfo9KOJ32lvelmEfyCD+l0K+jtzt3+IaczR7uqcLOD+/P5B", - "lykQdn/S1FUB9+MQmO2eogGWdn2ld4tHIxDovNxL2NfglyqXgjvVHKuQFjk8W2KXmJkhRlhK0Cntgs5K", - "6Qbz+ipjwFSN7+eyRQOyZ2xlV7r1oQOw2sUjismMbmV9DH5T0egsb+ZSqovhIWHw6A2pittWcq1qdWs+", - "C/NDAPRn7+S4sPTrqm0GEECAMs9qJmNjPNGHkh21ODIVrYiZ/tbWyF2VlsiCx6OxgZg1v/YK+0MmkA8J", - "C3K1Nwp1TpHU426hzTUVCNAAXekMrlGsohvm3FVlzZ+sxJllOPTSAJHVUMwRW6YvwGVOnTNF6JXpMgwd", - "6AAomWhWabSGsWbrCZRcRr3Dqzi6GmIq4arcDehaGee2Uxc1B7uMKIIpSvFYNsxrArp38+3/V5P82elA", - "yYzepStfuX1IxdMlSXfvWn7f0e5G2gDSqhjKOtUxzJ1bISQKybjKaolHteKkJtCUJ5ZjtMPdzbr05NY5", - "G0+FF2khJKae2ySotO8eYGG2S/OrCyV1+qA1INt8WKpOQxrffThCRnHcpkih6dt7c/Rmr4+Odnr9l25G", - "UTOb6q/Q27OT9yhdX5mjgt+eVP0WjmxTJlSo5Qd739j3jT98xAqxKB+EfZ+LwHg9jhLeJIqQCX1+1/aj", - "IAqWSd3mKXmxP0VivJCji1dqVuouLgQoFRePIqg5DK2SiTZMN4RbHHtPImA6qBvzd40IP0mIiqI6cUO9", - "p3a8JZIW+rLy6TkpiRtwLJ2PmXxjdhiybETWd8B/kTep99L+Lr+L4O2SUbpUkO4QpJPc3JB8QEZmRu7z", - "MOQBF1C343Y3JidBNn8zc7QClmx3Ab3sxQM3nOBDlKB/tQx9OqNfhJ/Ltg9tUwavNOlKfw61dNBlT/4N", - "5lwqVYhEGZPt9+VTrmRo+tNDLvXbh1wzcykrlnQs5YjN/e5Bx1wZYR/Qy2RjyHRGcQi5d3b1MrmziJl8", - "5Vjjx1LxUNfwBubsItL52ZFmXeLL5022+sl49yliUKLES+ZaKk/Dr461cr9gmGfoj2LQqUP5ZV44A372", - "MVqCd9Upmjv/xEO0VBlKTiQX0Zrfk98SrzhAm7dRYw6kNvBjXc7yL6RXm571k4XCZx6e5fE+3exsvvx+", - "cHI2R2QHoJ5SXmvP4PycIJYNzVxM/L0zs0XiXDoxmyNCe+CRpfi047LykvLceUNebH+3YdlSnXz2UVkB", - "7xNNyhbq8MpzsjnKfBqr36DJjyX2ihnZytnY71HL/09Z4D/DAKutqJzeFTsexT31L5faNuxvPat6o0fc", - "xxQFMAHKoxAMBrv53fTKu7P5zfLcvvGp4EHsm9zINj2Ku+OlH+uvDrnLFIzc8v8c0HXC1M+C34fJXLAB", - "TGbBXqbcn4WfW7MvFPTFPeUyXcXvcguvxf8rUcWXSee/2GZPPyw+nv951iFUJAQ3mnXNQgcq6xWWweja", - "2nXOskVp+/fD5cP/BQAA//9RbZ2ux0kAAA==", + "SpBB7NDxCJgck6HqGE0f2acQ129BqnprEYO7gfET2e22v3skWNFk5wE9LYCb1emEHQEMiX6Y8OUr648B", + "HRCt7RGXWsumiEgUy9jwKsQMjyBAg6mx/J3TLsIsQDhWfAQMBFYQOCBSjvchonz6DqbollCKBpD/vqfg", + "FgvtF4o3x0X7WcSCvKk9GIlEFE+PjeOp8Fv6JdJvZ7xqXsre+ymagL50GHGhMFO5U47XWu5sZDBOGQ6J", + "n2rgImL37dmC0j7UvOEq385+NCLqDCK+7LMDd0x/QfkAU/fgDCZEEusfi1yykrdvkeIoTtydZpeF4exF", + "xIbxaFTQFSN7IpHCNyBRJMCHAJgPiE9AGCAp9JzZaVxjQP00jmTimLQa6412Fe8JkwpTen52VOFmz440", + "9UNQ/hi5g1r3yBCkkmjIRaJ+qSXgETDVQIZ6o62c0alWWQkKkYK+vJBI8Rtg2jCk0mcnmJKgSPhYqUhu", + "N5s4IsZJT+SYNRiopiOnKS0BDR2o/sfA+/fXeG2t7UvwBai+fmIegHEoODhhdJqEzhI3rHf/NflaGH8P", + "+S7wbC5olFymSp8X79ydSVSQ0jdI5D4AytlIS7RAVxhTRXwuokrSskzmS4L2soLgKpMvOyZ7CA0Xxqsd", + "ASgCQXjgolYcRNrZak96Krg+hHpTZryxHPOYBohxlehviJnx3zMB7SYegGCgQF6ASBRmEBMa7GOlr7K+", + "tt6qr3Xqrc1+a2t7rbPd6fzl1UyCS6jODLyR7xl3tMfDkOjs4o9grdNe/2O9g7eGwVbndWew+brV/mPw", + "erO95rfbw/U/NoJ2e31oP+sLAB2KbRYLmNnHKTlGP9Yam/+6acuWfsezVyPearQ2Gq01r+aF+JprcvSZ", + "kDDz73X9IqJYDbkIvW2PEhbfNXEYbHaq9esg86pFEe05VbYWUYyOtTQ2pgEwFx1L0S1IQmIZS693iKJ4", + "QIlvMsMmsmfNH9pjOZXwC8T4WGHKRzNEOT/mUJsIXo68RUOUclyHYH1jo7WFdnZ2dvbax/d4r0X/2u+2", + "jvtvNvSz7v7BFt74eHsU3/p378+mwfG3bocP4/tPsS9230UHJ5PTi63Tk84ovv7Kqpz2mEv1Dqay+vY3", + "jN8ypM/IxGS1+5EgtHd5aWySEgYo4lKSAQXDF/M4oqAZJV8VLjUiiuJBw+chWul+O8N47/DdRf/6W3w3", + "UZt77zdVcNDpHUWtXcWa7AQOD99snJ/cnwXDrywHHPxA4roc4/U6I1JF6xubBsmb9Yvrvw6Px0efjvnn", + "flcNQnofHO5Mj/ufDb7i37u7u29777/d/wkXW+L8/rxz85Gog2s465x+7OH1rd7ptz9bw4ubsbpuH95u", + "3V0fXXy6+CzOtz7Qzx/FydGn3ejD5ruP14Pr/n4/2L/hfPz2fjR48/nf1cKwD0qCiMAnQwJSRz1slCrx", + "KMUELhGPLlwEpxREA+24goYP0YuYucMvUAiYSUTUC2m8UohZDkb2fUF2OqesojoWtCLZjylFOurn1EZT", + "Pqvi283miKj/jIgax0Z0TeyHoP28fs4jWQ+nSa09Imq1uGTz99kUO2bkm+aEOYZIAExptgpkQTXQTqx4", + "mFYhVd5DB05fgLX0l8RGUe3N0FfP5goUlAJh04S6fYQDjZBMoPCU8ZgVHgRkRJS0j7566HYMApBOkyxI", + "ibAARPktCB9LqKEQ36HNNvLHWGDfHND0cIXpq0a1enXZBJj2RhUhOXmFdHGrhYZzaXbRY/pZFVqRA+ZQ", + "zMhlJkwnYKri9Pukyi7lFDgiudBYws9J4C9Lwk+6+3s2gJRoykGvIiv3ZYkwnxIwbZUqsgIifZ2QTc+t", + "rWiVwTo4x4LUFYQ6KMLSxKYApZZhrCLV9U8qzMB2SYyjzjo4szIWcz7vm4TSAAhBSjyCgkHvgo91BsuH", + "7pRceimHqfoOWdY8S968fPqsKpfGs0nzam4kgQVBLhFZrfGSFXrL2lzuIqZ/kiXSq2FJuoNL0diDs+2a", + "9PNHbHaUMFVooMv6AxgS9hTNjh1KUXYfBHc+RAoxHILxodxQgmnemTeeu+vBcl0PV7DkDWnHDwHtcRE1", + "qhz5it2Gsv4+Y99hxaZBgZzK1kEpk8gjT7Lun08vLLhVc4uHmifBjwVR057mstWVXcACxE6sxqZeM3+9", + "TVz8nx/7nutHa0j2bYZrrFRk29yEDXnSP8e+cQMQYkK9bfPqP6Zh4ec6+Re9w2O0c+C5FCztcCQHS63z", + "fF363thSCEy5sogSH5g0Kuvg7/b2Ubu+R41LP3KvZ5H5Y84lYPe1YbH7t2wOZFBv130DoGkSXKKMZI4I", + "xM4LWOSTrL5ca2w01kwsj4DhiHjbXrux1ljXForV2DC8qf8zgorewoEurl324Gr3DJlngFqV0W5PW6ON", + "qN7MOGN9be3RRhlpMlMxzMgxIp0smEPpNKUKckpqMxm75BXT2/5yWfNkHIZY52EzzEZnnBtVxyOp46+c", + "SgWhd6khNF1OJuey94hIpQ0xOYjwBBOKdeXnsmErzyKb9Vd7CehaYQD3pWTuhCoQGQLt6y3xJCiWI3DP", + "+WYy4/oWWykWhlxefqRVsu1SncWFQlRfcDBFQwK0iM+gr8IluVD/O5gWkKUCtJ8Bi0PNbPNHSls+UFyW", + "nc/lL+okURCu2sjOTUOwEHhapavuqGGRqZfehJGaInNel6aMO0nltKLx89qc6u8ZqFgwibAVTk77cmqc", + "VhMPNS/iskJ193Soh1wnL1NYl3h093WyUVn3FWq9K//nK7srW9h9Zbqy0xBvuQh+sLbrKuSPwb+RSRvc", + "GQjcEakkGsCQC3CpDRuZEzZ+1RBXYxC3RAIaYkKlBZbcWJqjV07OV0mlrFMsoiS6srdxsboXgZ9cSZ+4", + "GnCupBI4Mo3yK9t3MBO7ojOwcthLi0tdDIBUuzyYPprLTbW6QosTNWBwi4pUZKPwh5LptZ6FNqeZRnSg", + "03qv84iBaP5MPUWM2QvToy5QsFFhTMmQhgrAwdSp3iMYuxWPdPLJTfpKdp6PV83v6cbFgyWWgqrKvs1z", + "WWhuzGQE5kSmFzOxqupK2ZFmxTJJhRvvzOenJdzxvf2MkjeIie0LDEgQAHsEYVaxu8phV6Yaqdu347wY", + "5Gxbqii5A1BPK7a153QBQx4zpwadRfsCaU0mXZc4QCRAt1hqQzZAHjUEz5VFZRzGyh9XzIKjAC82Qnvi", + "0aW5SpwJQYygbij/108JNd9kKYvX3qwovVyrQnHjfMe2Hf/y7O0eet3e2ny1QoB6Vu2MzTV+g5uyiB/V", + "SVWpY6U2x2q+LvMkaC9S69NY/RadfjTxO+1NL4vwD2RQv0tBf2fu9g8xjTnaXZ2TBdyf3z/oMgXC7kKa", + "uirgfhwCs91TNMDSLqf0bvFoBAKdl3sJ+xr8UuVScKeaYxXSIodnS+wSMzPECEsJOqVd0Fkp3WBeX2UM", + "mKrx/Vy2aED2jK3sSrc+dABWu3hEMZnRrayPwW8qGp3lLVtKdTE8JAwevSFVcdtKrlUtZs1nYX4IgP7s", + "nRwXFnhdtc0AAghQ5lnNHGyMJ/pQsoEWR6aiFTHT39oauavSElnweDQ2ELPm115hO8gE8iFhQa72RqHO", + "KZJ63K2ruaYCARqgK53BNYpVdMOcu6qs+ZOFN7Pqhl4aILIaijliy/QFuMypc6YIvTJdhqEDHQAlE80q", + "jdYw1uw0gZLLqHd4FUdXQ0wlXJW7AV0r49zu6aLmYJcRRTBFKR7LhnlNQPduvv3/apI/Ox0omdG7dKEr", + "t+2oeLoC6e5dy28z2s1HG0BaFSNYpzqGuXMrhEQhGVdZLfGoVpzUBJryxHKMdri7WZee3Dpn46nwIi2E", + "xNRzewOV9t0DLMzuaH5RoaROH7QGZHsOS9VpSOO7D0fIKI7bAyk0fXtvjt7s9dHRTq//0s0oambr/BV6", + "e3byHqXLKXNU8NuTqt/CAW3KhAq1/GDvG/u+8YePWCEW5YOw73MRGK/HUcKbRBEyoc/v2n4URMEyqds8", + "JS/2p0iMF3J08QLNSt3FhQCl4uJRBDWHoVUy0YbphnCLY+9JBEwHdWP+rhHhJwlRUVQnbqj31I63RNJC", + "X1Y+PSclcQOOpfMxk2/MDkOWjcj6Dvgv8ib1Xtrf5XcRvF0ySpcK0h2CdJKbG5IPyMjMyH0ehjzgAup2", + "3O7G5CTI5m9mjlbAku0uoJe9eOCGE3yIEvSvlqFPZ/SL8HPZ9qFtyuCVJl3pT5uWDrrsyb/BnEulCpEo", + "Y7LbvnzKlQxNf3rIpX77kGtmLmXFko6lHLG5XzXomCsj7AN6mWwMmc4oDiH3zi5WJncWMZOvHGv8WCoe", + "6hrewJxdRDo/O9KsS3z5vMlWPxnvPkUMSpR4yVxL5Wn41bFW7vcJ8wz9UQw6dSi/zAtnwM8+RkvwrjpF", + "c+efeIiWKkPJieQiWvN78rvgFQdo8zZqzIHUBn6sy1n+tfNq07N+slD4zMOzPN6nm53Nl98PTs7miOwA", + "1FPKa+0ZnJ8TxLKhmYuJv3dmtkicSydmc0RoDzyyFJ92XFZeSZ47b8iL7e82LFuqk88+KivgfaJJ2UId", + "XnlONkeZT2P1GzT5scReMSNbORv7PWr5/ykL/GcYYLUVldO7YsejuKf+5VLbhv0lZ1Vv9Ij7mKIAJkB5", + "FILBYDe/m155dza/WZ7bNz4VPIh9kxvZpkdxd7z0U/zVIXeZgpFb/p8Duk6Y+lnw+zCZCzaAySzYy5T7", + "s/Bza/aFgr64p1ymq/hdbuG1+H8Yqvgy6fwX2+zph8XH8z/POoSKhOBGs65Z6EBlvcIyGF1bu85Ztiht", + "/364fPi/AAAA//+2KOvJk0kAAA==", } // GetSwagger returns the content of the embedded swagger specification file @@ -719,16 +3346,16 @@ var swaggerSpec = []string{ func decodeSpec() ([]byte, error) { zipped, err := base64.StdEncoding.DecodeString(strings.Join(swaggerSpec, "")) if err != nil { - return nil, fmt.Errorf("error base64 decoding spec: %s", err) + return nil, fmt.Errorf("error base64 decoding spec: %w", err) } zr, err := gzip.NewReader(bytes.NewReader(zipped)) if err != nil { - return nil, fmt.Errorf("error decompressing spec: %s", err) + return nil, fmt.Errorf("error decompressing spec: %w", err) } var buf bytes.Buffer _, err = buf.ReadFrom(zr) if err != nil { - return nil, fmt.Errorf("error decompressing spec: %s", err) + return nil, fmt.Errorf("error decompressing spec: %w", err) } return buf.Bytes(), nil @@ -746,7 +3373,7 @@ func decodeSpecCached() func() ([]byte, error) { // Constructs a synthetic filesystem for resolving external references when loading openapi specifications. func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { - var res = make(map[string]func() ([]byte, error)) + res := make(map[string]func() ([]byte, error)) if len(pathToFile) > 0 { res[pathToFile] = rawSpec } @@ -760,12 +3387,12 @@ func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { // Externally referenced files must be embedded in the corresponding golang packages. // Urls can be supported but this task was out of the scope. func GetSwagger() (swagger *openapi3.T, err error) { - var resolvePath = PathToRawSpec("") + resolvePath := PathToRawSpec("") loader := openapi3.NewLoader() loader.IsExternalRefsAllowed = true loader.ReadFromURIFunc = func(loader *openapi3.Loader, url *url.URL) ([]byte, error) { - var pathToFile = url.String() + pathToFile := url.String() pathToFile = path.Clean(pathToFile) getSpec, ok := resolvePath[pathToFile] if !ok { diff --git a/pkg/api/openapi_custom.go b/pkg/api/openapi_custom.go index d45007f..549a5be 100644 --- a/pkg/api/openapi_custom.go +++ b/pkg/api/openapi_custom.go @@ -1,6 +1,9 @@ package api // String returns the underlying string value of `Id`. -func (id Id) String() string { - return string(id) +func (id *Id) String() string { + if id == nil { + return "" + } + return string(*id) } diff --git a/pkg/api/utils.go b/pkg/api/utils.go index 007d36f..8fd1f51 100644 --- a/pkg/api/utils.go +++ b/pkg/api/utils.go @@ -31,7 +31,7 @@ var ( func GenerateClusterID() (ClusterId, error) { id, err := generateID(ClusterIDPrefix) return ClusterId{ - Id: id, + Id: &id, }, err } @@ -39,7 +39,7 @@ func GenerateClusterID() (ClusterId, error) { func GenerateTenantID() (TenantId, error) { id, err := generateID(TenantIDPrefix) return TenantId{ - Id: id, + Id: &id, }, err } @@ -60,8 +60,9 @@ func generateID(prefix string) (Id, error) { // NewAPITenantFromCRD transforms a CRD tenant into the API representation func NewAPITenantFromCRD(tenant synv1alpha1.Tenant) *Tenant { + id := Id(tenant.Name) apiTenant := &Tenant{ - TenantId: TenantId{Id: Id(tenant.Name)}, + TenantId: TenantId{Id: &id}, TenantProperties: TenantProperties{ GitRepo: &RevisionedGitRepo{}, }, @@ -107,14 +108,15 @@ func NewAPITenantFromCRD(tenant synv1alpha1.Tenant) *Tenant { // NewCRDFromAPITenant transforms an API tenant into the CRD representation func NewCRDFromAPITenant(apiTenant Tenant) (*synv1alpha1.Tenant, error) { if !strings.HasPrefix(apiTenant.Id.String(), TenantIDPrefix) { - if apiTenant.Id == "" { + if apiTenant.Id.String() == "" { id, err := GenerateTenantID() if err != nil { return nil, err } apiTenant.TenantId = id } else { - apiTenant.Id = TenantIDPrefix + apiTenant.Id + id := TenantIDPrefix + *apiTenant.Id + apiTenant.Id = &id } } if apiTenant.GitRepo == nil || @@ -131,7 +133,7 @@ func NewCRDFromAPITenant(apiTenant Tenant) (*synv1alpha1.Tenant, error) { } if apiTenant.GitRepo != nil { - tmpl, err := newGitRepoTemplate(&apiTenant.GitRepo.GitRepo, string(apiTenant.Id)) + tmpl, err := newGitRepoTemplate(&apiTenant.GitRepo.GitRepo, apiTenant.Id.String()) if err != nil { return nil, fmt.Errorf("failed to create git repo template: %w", err) } @@ -179,8 +181,9 @@ func SyncCRDFromAPITenant(source TenantProperties, target *synv1alpha1.Tenant) { // NewAPIClusterFromCRD transforms a CRD cluster into the API representation func NewAPIClusterFromCRD(cluster synv1alpha1.Cluster) *Cluster { + id := Id(cluster.Name) apiCluster := &Cluster{ - ClusterId: ClusterId{Id: Id(cluster.Name)}, + ClusterId: ClusterId{Id: &id}, ClusterProperties: ClusterProperties{ GitRepo: &GitRepo{}, }, @@ -257,20 +260,21 @@ func unmarshalFact(fact string) interface{} { // NewCRDFromAPICluster transforms an API cluster into the CRD representation func NewCRDFromAPICluster(apiCluster Cluster) (*synv1alpha1.Cluster, error) { - if !strings.HasPrefix(string(apiCluster.Id), ClusterIDPrefix) { - if apiCluster.Id == "" { + if !strings.HasPrefix(apiCluster.Id.String(), ClusterIDPrefix) { + if apiCluster.Id.String() == "" { id, err := GenerateClusterID() if err != nil { return nil, err } apiCluster.ClusterId = id } else { - apiCluster.Id = ClusterIDPrefix + apiCluster.Id + id := Id(ClusterIDPrefix + apiCluster.Id.String()) + apiCluster.Id = &id } } cluster := &synv1alpha1.Cluster{ ObjectMeta: metav1.ObjectMeta{ - Name: string(apiCluster.ClusterId.Id), + Name: apiCluster.Id.String(), Annotations: map[string]string{}, }, Spec: synv1alpha1.ClusterSpec{ @@ -280,7 +284,7 @@ func NewCRDFromAPICluster(apiCluster Cluster) (*synv1alpha1.Cluster, error) { }, } - tmpl, err := newGitRepoTemplate(apiCluster.GitRepo, string(apiCluster.Id)) + tmpl, err := newGitRepoTemplate(apiCluster.GitRepo, apiCluster.Id.String()) if err != nil { return nil, fmt.Errorf("failed to create git repo template: %w", err) } diff --git a/pkg/api/utils_test.go b/pkg/api/utils_test.go index 4c58ffc..1f863f5 100644 --- a/pkg/api/utils_test.go +++ b/pkg/api/utils_test.go @@ -80,7 +80,7 @@ func TestGenerateClusterID(t *testing.T) { assertGeneratedID(t, ClusterIDPrefix, func() (s string) { id, err := GenerateClusterID() require.NoError(t, err) - return string(id.Id) + return id.Id.String() }) } @@ -168,9 +168,10 @@ var tenantTests = map[string]struct { func TestNewCRDFromAPITenant(t *testing.T) { for name, test := range tenantTests { t.Run(name, func(t *testing.T) { + id := Id(fmt.Sprintf("t-%s", t.Name())) apiTenant := Tenant{ TenantId{ - Id: Id(fmt.Sprintf("t-%s", t.Name())), + Id: &id, }, test.properties, } @@ -234,7 +235,7 @@ func TestNewCRDFromAPICluster(t *testing.T) { t.Run(name, func(t *testing.T) { apiCluster := Cluster{ ClusterId{ - Id: Id(fmt.Sprintf("c-%s", t.Name())), + Id: pointer.To(Id(fmt.Sprintf("c-%s", t.Name()))), }, ClusterTenant{fmt.Sprintf("t-%s", t.Name())}, test.properties, diff --git a/pkg/service/api_service.go b/pkg/service/api_service.go index 99fd717..ce44abd 100644 --- a/pkg/service/api_service.go +++ b/pkg/service/api_service.go @@ -54,6 +54,11 @@ func NewAPIServer(conf APIConfig, k8sMiddleware ...KubernetesAuth) (*echo.Echo, if err != nil { return nil, fmt.Errorf("error loading swagger spec: %w", err) } + + // Clear out the servers array in the swagger spec, that skips validating + // that server names match. We don't know how/where this thing will be run. + swagger.Servers = nil + swaggerJSON, err = swagger.MarshalJSON() if err != nil { return nil, fmt.Errorf("error marshalling swagger spec: %w", err) diff --git a/pkg/service/api_service_test.go b/pkg/service/api_service_test.go index 607948d..fd45268 100644 --- a/pkg/service/api_service_test.go +++ b/pkg/service/api_service_test.go @@ -257,7 +257,7 @@ func TestHealthz(t *testing.T) { e, _ := setupTest(t) result := testutil.NewRequest().Get("/healthz").Go(t, e) - assert.Equal(t, http.StatusOK, result.Code()) + requireHTTPCode(t, http.StatusOK, result) assert.Equal(t, "ok", string(result.Recorder.Body.String())) } @@ -265,7 +265,7 @@ func TestOpenAPI(t *testing.T) { e, _ := setupTest(t) result := testutil.NewRequest().Get("/openapi.json").Go(t, e) - assert.Equal(t, http.StatusOK, result.Code()) + requireHTTPCode(t, http.StatusOK, result) swaggerSpec := &openapi3.T{} err := json.Unmarshal(result.Recorder.Body.Bytes(), swaggerSpec) assert.NoError(t, err) @@ -277,7 +277,7 @@ func TestSwaggerUI(t *testing.T) { e, _ := setupTest(t) result := testutil.NewRequest().Get("/docs").Go(t, e) - assert.Equal(t, http.StatusOK, result.Code()) + requireHTTPCode(t, http.StatusOK, result) assert.NotEmpty(t, result.Recorder.Body.Bytes) } @@ -285,7 +285,7 @@ func TestDiscovery(t *testing.T) { e, _ := setupTest(t) result := testutil.NewRequest().Get("/").Go(t, e) - assert.Equal(t, http.StatusOK, result.Code()) + requireHTTPCode(t, http.StatusOK, result) assert.NotEmpty(t, result.Recorder.Body.Bytes) metadata := api.Metadata{} err := json.Unmarshal(result.Recorder.Body.Bytes(), &metadata) diff --git a/pkg/service/cluster.go b/pkg/service/cluster.go index d1e6bda..f52b635 100644 --- a/pkg/service/cluster.go +++ b/pkg/service/cluster.go @@ -7,6 +7,7 @@ import ( "os" "sort" + "github.com/AlekSi/pointer" "github.com/labstack/echo/v4" synv1alpha1 "github.com/projectsyn/lieutenant-operator/api/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" @@ -70,7 +71,7 @@ func sortClustersBy(clusters []api.Cluster, by *api.ListClustersParamsSortBy) { return di < dj default: - return clusters[i].Id < clusters[j].Id + return clusters[i].Id.String() < clusters[j].Id.String() } }) } @@ -188,7 +189,7 @@ func (s *APIImpl) PutCluster(c echo.Context, clusterID api.ClusterIdParameter) e return echo.NewHTTPError(http.StatusBadRequest, err) } apiCluster := api.Cluster(*body) - apiCluster.Id = api.Id(clusterID) + apiCluster.Id = pointer.To(api.Id(clusterID)) cluster, err := api.NewCRDFromAPICluster(apiCluster) if err != nil { diff --git a/pkg/service/cluster_test.go b/pkg/service/cluster_test.go index 387e998..8fd73bf 100644 --- a/pkg/service/cluster_test.go +++ b/pkg/service/cluster_test.go @@ -26,7 +26,7 @@ func TestListCluster(t *testing.T) { Get("/clusters"). WithHeader(echo.HeaderAuthorization, bearerToken). Go(t, e) - require.Equal(t, http.StatusOK, result.Code()) + requireHTTPCode(t, http.StatusOK, result) clusters := make([]api.Cluster, 0) err := result.UnmarshalJsonToObject(&clusters) assert.NoError(t, err) @@ -47,7 +47,7 @@ func TestListCluster_FilteredByTenant(t *testing.T) { Get("/clusters?tenant="+tenantA.Name). WithHeader(echo.HeaderAuthorization, bearerToken). Go(t, e) - require.Equal(t, http.StatusOK, result.Code()) + requireHTTPCode(t, http.StatusOK, result) clusters := make([]api.Cluster, 0) err := result.UnmarshalJsonToObject(&clusters) assert.NoError(t, err) @@ -98,13 +98,13 @@ func TestListCluster_Sort(t *testing.T) { Get(fmt.Sprintf("/clusters?sort_by=%s", tc.sortBy)). WithHeader(echo.HeaderAuthorization, bearerToken). Go(t, e) - require.Equal(t, http.StatusOK, result.Code()) + requireHTTPCode(t, http.StatusOK, result) clusters := make([]api.Cluster, 0) err := result.UnmarshalJsonToObject(&clusters) assert.NoError(t, err) assert.Len(t, clusters, 3) for i := range tc.order { - assert.Equal(t, tc.order[i], string(clusters[i].Id)) + assert.Equal(t, tc.order[i], clusters[i].Id.String()) } }) } @@ -116,7 +116,7 @@ func TestListClusterMissingBearer(t *testing.T) { result := testutil.NewRequest(). Get("/clusters"). Go(t, e) - assert.Equal(t, http.StatusBadRequest, result.Code()) + requireHTTPCode(t, http.StatusBadRequest, result) } func TestListClusterWrongToken(t *testing.T) { @@ -126,7 +126,7 @@ func TestListClusterWrongToken(t *testing.T) { Get("/clusters"). WithHeader(echo.HeaderAuthorization, "asdf"). Go(t, e) - assert.Equal(t, http.StatusBadRequest, result.Code()) + requireHTTPCode(t, http.StatusBadRequest, result) } func TestCreateCluster(t *testing.T) { @@ -158,14 +158,14 @@ func TestCreateCluster(t *testing.T) { WithJsonBody(newCluster). WithHeader(echo.HeaderAuthorization, bearerToken). Go(t, e) - assert.Equal(t, http.StatusCreated, result.Code()) + requireHTTPCode(t, http.StatusCreated, result) cluster := &api.Cluster{} err = result.UnmarshalJsonToObject(cluster) assert.NoError(t, err) assert.NotNil(t, cluster) - assert.Contains(t, cluster.Id, api.ClusterIDPrefix) + assert.Contains(t, cluster.Id.String(), api.ClusterIDPrefix) assert.Equal(t, cluster.DisplayName, newCluster.DisplayName) assert.Equal(t, newCluster.Facts, cluster.Facts) assert.Equal(t, newCluster.DynamicFacts, cluster.DynamicFacts) @@ -194,7 +194,7 @@ func TestCreateClusterWithId(t *testing.T) { request := api.Cluster{ ClusterId: api.ClusterId{ - Id: tt.request, + Id: pointer.To(tt.request), }, ClusterProperties: api.ClusterProperties{ DisplayName: pointer.ToString("My test cluster"), @@ -206,11 +206,11 @@ func TestCreateClusterWithId(t *testing.T) { WithJsonBody(request). WithHeader(echo.HeaderAuthorization, bearerToken). Go(t, e) - assert.Equal(t, http.StatusCreated, result.Code()) + requireHTTPCode(t, http.StatusCreated, result) cluster := &api.Cluster{} err := result.UnmarshalJsonToObject(cluster) assert.NoError(t, err) - assert.Equal(t, tt.response, cluster.Id) + assert.Equal(t, tt.response.String(), cluster.Id.String()) }) } } @@ -238,7 +238,7 @@ func TestCreateClusterInstanceFact(t *testing.T) { WithJsonBody(newCluster). WithHeader(echo.HeaderAuthorization, bearerToken). Go(t, e) - assert.Equal(t, http.StatusCreated, result.Code()) + requireHTTPCode(t, http.StatusCreated, result) cluster := &api.Cluster{} err = result.UnmarshalJsonToObject(cluster) @@ -252,7 +252,7 @@ func TestCreateClusterInstanceFact(t *testing.T) { WithJsonBody(newCluster). WithHeader(echo.HeaderAuthorization, bearerToken). Go(t, e) - assert.Equal(t, http.StatusCreated, result.Code()) + requireHTTPCode(t, http.StatusCreated, result) cluster = &api.Cluster{} err = result.UnmarshalJsonToObject(cluster) assert.NoError(t, err) @@ -269,7 +269,7 @@ func TestCreateClusterNoJSON(t *testing.T) { WithBody([]byte("invalid-body")). WithHeader(echo.HeaderAuthorization, bearerToken). Go(t, e) - assert.Equal(t, http.StatusBadRequest, result.Code()) + requireHTTPCode(t, http.StatusBadRequest, result) reason := &api.Reason{} err := result.UnmarshalJsonToObject(reason) assert.NoError(t, err) @@ -280,6 +280,7 @@ func TestCreateClusterNoTenant(t *testing.T) { e, _ := setupTest(t) createCluster := map[string]string{ + "id": "c-1234", "displayName": "cluster-name", } result := testutil.NewRequest(). @@ -287,7 +288,7 @@ func TestCreateClusterNoTenant(t *testing.T) { WithJsonBody(createCluster). WithHeader(echo.HeaderAuthorization, bearerToken). Go(t, e) - assert.Equal(t, http.StatusBadRequest, result.Code()) + requireHTTPCode(t, http.StatusBadRequest, result) reason := &api.Reason{} err := result.UnmarshalJsonToObject(reason) assert.NoError(t, err) @@ -302,7 +303,7 @@ func TestCreateClusterEmpty(t *testing.T) { WithJsonContentType(). WithHeader(echo.HeaderAuthorization, bearerToken). Go(t, e) - assert.Equal(t, http.StatusBadRequest, result.Code()) + requireHTTPCode(t, http.StatusBadRequest, result) reason := &api.Reason{} err := result.UnmarshalJsonToObject(reason) assert.NoError(t, err) @@ -316,7 +317,7 @@ func TestClusterDelete(t *testing.T) { Delete("/clusters/"+clusterA.Name). WithHeader(echo.HeaderAuthorization, bearerToken). Go(t, e) - assert.Equal(t, http.StatusNoContent, result.Code()) + requireHTTPCode(t, http.StatusNoContent, result) } func TestClusterGet(t *testing.T) { @@ -326,12 +327,12 @@ func TestClusterGet(t *testing.T) { Get("/clusters/"+clusterA.Name). WithHeader(echo.HeaderAuthorization, bearerToken). Go(t, e) - assert.Equal(t, http.StatusOK, result.Code()) + requireHTTPCode(t, http.StatusOK, result) cluster := &api.Cluster{} err := result.UnmarshalJsonToObject(cluster) assert.NoError(t, err) assert.NotNil(t, cluster) - assert.Equal(t, clusterA.Name, string(cluster.ClusterId.Id)) + assert.Equal(t, clusterA.Name, cluster.Id.String()) assert.Equal(t, tenantA.Name, cluster.Tenant) assert.Equal(t, clusterA.Spec.GitHostKeys, *cluster.GitRepo.HostKeys) assert.True(t, strings.HasSuffix(*cluster.InstallURL, clusterA.Status.BootstrapToken.Token)) @@ -345,12 +346,12 @@ func TestClusterGetNoToken(t *testing.T) { Get("/clusters/"+clusterB.Name). WithHeader(echo.HeaderAuthorization, bearerToken). Go(t, e) - assert.Equal(t, http.StatusOK, result.Code()) + requireHTTPCode(t, http.StatusOK, result) cluster := &api.Cluster{} err := result.UnmarshalJsonToObject(cluster) assert.NoError(t, err) assert.NotNil(t, cluster) - assert.Equal(t, clusterB.Name, string(cluster.ClusterId.Id)) + assert.Equal(t, clusterB.Name, cluster.Id.String()) assert.Equal(t, tenantB.Name, cluster.Tenant) assert.Nil(t, cluster.InstallURL) } @@ -362,7 +363,7 @@ func TestClusterGetNotFound(t *testing.T) { Get("/clusters/not-existing"). WithHeader(echo.HeaderAuthorization, bearerToken). Go(t, e) - assert.Equal(t, http.StatusNotFound, result.Code()) + requireHTTPCode(t, http.StatusNotFound, result) reason := &api.Reason{} err := result.UnmarshalJsonToObject(reason) assert.NoError(t, err) @@ -376,7 +377,7 @@ func TestClusterUpdateEmpty(t *testing.T) { Patch("/clusters/1"). WithHeader(echo.HeaderAuthorization, bearerToken). Go(t, e) - assert.Equal(t, http.StatusBadRequest, result.Code()) + requireHTTPCode(t, http.StatusBadRequest, result) reason := &api.Reason{} err := result.UnmarshalJsonToObject(reason) assert.NoError(t, err) @@ -396,7 +397,7 @@ func TestClusterUpdateTenant(t *testing.T) { WithContentType(api.ContentJSONPatch). WithHeader(echo.HeaderAuthorization, bearerToken). Go(t, e) - assert.Equal(t, http.StatusBadRequest, result.Code()) + requireHTTPCode(t, http.StatusBadRequest, result) reason := &api.Reason{} err := result.UnmarshalJsonToObject(reason) assert.NoError(t, err) @@ -418,7 +419,7 @@ func TestClusterUpdateUnknown(t *testing.T) { WithContentType(api.ContentJSONPatch). WithHeader(echo.HeaderAuthorization, bearerToken). Go(t, e) - assert.Equal(t, http.StatusBadRequest, result.Code()) + requireHTTPCode(t, http.StatusBadRequest, result) reason := &api.Reason{} err := result.UnmarshalJsonToObject(reason) assert.NoError(t, err) @@ -440,7 +441,7 @@ func TestClusterUpdateIllegalDeployKey(t *testing.T) { WithContentType(api.ContentJSONPatch). WithHeader(echo.HeaderAuthorization, bearerToken). Go(t, e) - assert.Equal(t, http.StatusBadRequest, result.Code()) + requireHTTPCode(t, http.StatusBadRequest, result) reason := &api.Reason{} err := result.UnmarshalJsonToObject(reason) assert.NoError(t, err) @@ -462,7 +463,7 @@ func TestClusterUpdateNotManagedDeployKey(t *testing.T) { WithContentType(api.ContentJSONPatch). WithHeader(echo.HeaderAuthorization, bearerToken). Go(t, e) - assert.Equal(t, http.StatusBadRequest, result.Code()) + requireHTTPCode(t, http.StatusBadRequest, result) reason := &api.Reason{} err := result.UnmarshalJsonToObject(reason) assert.NoError(t, err) @@ -499,12 +500,12 @@ func TestClusterUpdate(t *testing.T) { WithContentType(api.ContentJSONPatch). WithHeader(echo.HeaderAuthorization, bearerToken). Go(t, e) - require.Equal(t, http.StatusOK, result.Code()) + requireHTTPCode(t, http.StatusOK, result) cluster := &api.Cluster{} err := result.UnmarshalJsonToObject(cluster) require.NoError(t, err) assert.NotNil(t, cluster) - assert.Equal(t, clusterB.Name, string(cluster.Id)) + assert.Equal(t, clusterB.Name, cluster.Id.String()) assert.Equal(t, newDisplayName, *cluster.DisplayName) assert.Equal(t, *updateCluster.GitRepo.DeployKey, *cluster.GitRepo.DeployKey) assert.Empty(t, (*cluster.Annotations)["existing"]) @@ -532,7 +533,7 @@ func TestClusterUpdateDisplayName(t *testing.T) { WithContentType(api.ContentJSONPatch). WithHeader(echo.HeaderAuthorization, bearerToken). Go(t, e) - require.Equal(t, http.StatusOK, result.Code()) + requireHTTPCode(t, http.StatusOK, result) cluster := &api.Cluster{} err := result.UnmarshalJsonToObject(cluster) require.NoError(t, err) @@ -576,7 +577,7 @@ var putClusterTestCases = map[string]struct { "put new object": { cluster: &api.Cluster{ ClusterId: api.ClusterId{ - Id: "c-new-2379", + Id: pointer.To(api.Id("c-new-2379")), }, ClusterProperties: api.ClusterProperties{ DisplayName: pointer.ToString("My new cluster"), @@ -596,7 +597,7 @@ var putClusterTestCases = map[string]struct { }, code: http.StatusCreated, valid: func(t *testing.T, act *api.Cluster) bool { - assert.Contains(t, act.Id, api.ClusterIDPrefix) + assert.Contains(t, act.Id.String(), api.ClusterIDPrefix) assert.Equal(t, pointer.ToString("My new cluster"), act.DisplayName) return true }, @@ -613,7 +614,7 @@ func TestClusterPut(t *testing.T) { WithJsonBody(tc.cluster). WithHeader(echo.HeaderAuthorization, bearerToken). Go(t, e) - require.Equal(t, tc.code, result.Code()) + requireHTTPCode(t, tc.code, result) res := &api.Cluster{} err := result.UnmarshalJsonToObject(res) @@ -637,7 +638,7 @@ func TestClusterPutCreateNameMissmatch(t *testing.T) { e, client := setupTest(t) cluster := &api.Cluster{ ClusterId: api.ClusterId{ - Id: "c-bar", + Id: pointer.To(api.Id("c-new-2379")), }, ClusterProperties: api.ClusterProperties{ DisplayName: pointer.ToString("My new cluster"), @@ -649,7 +650,7 @@ func TestClusterPutCreateNameMissmatch(t *testing.T) { WithJsonBody(cluster). WithHeader(echo.HeaderAuthorization, bearerToken). Go(t, e) - require.Equal(t, http.StatusCreated, result.Code()) + requireHTTPCode(t, http.StatusCreated, result) res := &api.Cluster{} err := result.UnmarshalJsonToObject(res) @@ -664,3 +665,9 @@ func TestClusterPutCreateNameMissmatch(t *testing.T) { }, clusterObj) require.NotNil(t, clusterObj) } + +// requireHTTPCode is a helper function to check the HTTP status code of a response and log the response body if the code is not as expected. +func requireHTTPCode(t *testing.T, expected int, result *testutil.CompletedRequest) { + t.Helper() + require.Equalf(t, expected, result.Code(), "Unexpected response code: %d, body: %s", result.Code(), string(result.Recorder.Body.String())) +} diff --git a/pkg/service/inventory_test.go b/pkg/service/inventory_test.go index ac1cc51..e6586f5 100644 --- a/pkg/service/inventory_test.go +++ b/pkg/service/inventory_test.go @@ -7,7 +7,6 @@ import ( "github.com/deepmap/oapi-codegen/pkg/testutil" "github.com/labstack/echo/v4" - "github.com/stretchr/testify/assert" "github.com/projectsyn/lieutenant-api/pkg/api" ) @@ -20,7 +19,7 @@ func TestQueryInventory(t *testing.T) { WithHeader(echo.HeaderAuthorization, bearerToken). Get("/inventory?q="+url.QueryEscape(query)). Go(t, e) - assert.Equal(t, http.StatusInternalServerError, result.Code()) + requireHTTPCode(t, http.StatusInternalServerError, result) } func TestUpdateInventory(t *testing.T) { @@ -38,5 +37,5 @@ func TestUpdateInventory(t *testing.T) { WithJsonBody(updateInventory). WithHeader(echo.HeaderAuthorization, bearerToken). Go(t, e) - assert.Equal(t, http.StatusInternalServerError, result.Code()) + requireHTTPCode(t, http.StatusInternalServerError, result) } diff --git a/pkg/service/steward_test.go b/pkg/service/steward_test.go index 0f9f1b8..10ce6c5 100644 --- a/pkg/service/steward_test.go +++ b/pkg/service/steward_test.go @@ -7,7 +7,6 @@ import ( "github.com/deepmap/oapi-codegen/pkg/testutil" "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -117,7 +116,7 @@ func TestInstallSteward(t *testing.T) { WithHeader("X-Forwarded-Proto", "https"). Get("/install/steward.json?token="+tc.bootstrapToken). Go(t, e) - require.Equalf(t, http.StatusOK, result.Code(), "Unexpected response code: %d, body: %s", result.Code(), string(result.Recorder.Body.String())) + requireHTTPCode(t, http.StatusOK, result) manifests := &corev1.List{} err := result.UnmarshalJsonToObject(&manifests) assert.NoError(t, err) @@ -154,7 +153,7 @@ func TestInstallStewardNoToken(t *testing.T) { result := testutil.NewRequest(). Get("/install/steward.json"). Go(t, e) - assert.Equal(t, http.StatusBadRequest, result.Code()) + requireHTTPCode(t, http.StatusBadRequest, result) reason := &api.Reason{} err := result.UnmarshalJsonToObject(reason) assert.NoError(t, err) @@ -167,7 +166,7 @@ func TestInstallStewardInvalidToken(t *testing.T) { result := testutil.NewRequest(). Get("/install/steward.json?token=NonExistentToken"). Go(t, e) - assert.Equal(t, http.StatusUnauthorized, result.Code()) + requireHTTPCode(t, http.StatusUnauthorized, result) reason := &api.Reason{} err := result.UnmarshalJsonToObject(reason) assert.NoError(t, err) @@ -180,7 +179,7 @@ func TestInstallStewardUsedToken(t *testing.T) { result := testutil.NewRequest(). Get("/install/steward.json?token="+clusterB.Status.BootstrapToken.Token). Go(t, e) - assert.Equal(t, http.StatusUnauthorized, result.Code()) + requireHTTPCode(t, http.StatusUnauthorized, result) reason := &api.Reason{} err := result.UnmarshalJsonToObject(reason) assert.NoError(t, err) diff --git a/pkg/service/tenant.go b/pkg/service/tenant.go index 9df0e23..09ab681 100644 --- a/pkg/service/tenant.go +++ b/pkg/service/tenant.go @@ -5,6 +5,7 @@ import ( "net/http" "os" + "github.com/AlekSi/pointer" "github.com/labstack/echo/v4" synv1alpha1 "github.com/projectsyn/lieutenant-operator/api/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" @@ -128,7 +129,7 @@ func (s *APIImpl) PutTenant(c echo.Context, tenantID api.TenantIdParameter) erro return echo.NewHTTPError(http.StatusBadRequest, err) } apiTenant := api.Tenant(*newTenant) - apiTenant.Id = api.Id(tenantID) + apiTenant.Id = pointer.To(api.Id(tenantID)) tenant, err := api.NewCRDFromAPITenant(apiTenant) if err != nil { diff --git a/pkg/service/tenant_test.go b/pkg/service/tenant_test.go index c491d66..1487745 100644 --- a/pkg/service/tenant_test.go +++ b/pkg/service/tenant_test.go @@ -24,7 +24,7 @@ func TestListTenants(t *testing.T) { Get("/tenants/"). WithHeader(echo.HeaderAuthorization, bearerToken). Go(t, e) - assert.Equal(t, http.StatusOK, result.Code()) + requireHTTPCode(t, http.StatusOK, result) tenants := []api.Tenant{} err := result.UnmarshalJsonToObject(&tenants) assert.NoError(t, err) @@ -57,13 +57,13 @@ func TestCreateTenant(t *testing.T) { WithJsonBody(newTenant). WithHeader(echo.HeaderAuthorization, bearerToken). Go(t, e) - assert.Equal(t, http.StatusCreated, result.Code()) + requireHTTPCode(t, http.StatusCreated, result) tenant := &api.Tenant{} err := result.UnmarshalJsonToObject(tenant) assert.NoError(t, err) assert.NotNil(t, tenant) assert.NotNil(t, tenant.GitRepo) - assert.Contains(t, tenant.Id, api.TenantIDPrefix) + assert.Contains(t, tenant.Id.String(), api.TenantIDPrefix) assert.Equal(t, newTenant.DisplayName, tenant.DisplayName) assert.Equal(t, newTenant.GitRepo.Url, tenant.GitRepo.Url) assert.NotNil(t, tenant.GitRepo.Type) @@ -73,7 +73,7 @@ func TestCreateTenant(t *testing.T) { tenantCRD := &synv1alpha1.Tenant{} err = client.Get(context.TODO(), types.NamespacedName{ - Name: string(tenant.Id), + Name: tenant.Id.String(), Namespace: "default", }, tenantCRD) assert.NoError(t, err) @@ -101,7 +101,7 @@ func TestCreateTenantWithID(t *testing.T) { requestBody := api.Tenant{ TenantId: api.TenantId{ - Id: tt.request, + Id: &tt.request, }, TenantProperties: api.TenantProperties{ DisplayName: pointer.ToString("Tenant with ID"), @@ -119,7 +119,8 @@ func TestCreateTenantWithID(t *testing.T) { assert.Equal(t, http.StatusCreated, response.Code()) tenant := &api.Tenant{} assert.NoError(t, response.UnmarshalJsonToObject(tenant)) - assert.Equal(t, tt.response, tenant.Id) + require.NotNil(t, tenant.Id) + assert.Equal(t, tt.response, *tenant.Id) }) } } @@ -133,7 +134,7 @@ func TestCreateTenantFail(t *testing.T) { WithBody([]byte("invalid-body")). WithHeader(echo.HeaderAuthorization, bearerToken). Go(t, e) - assert.Equal(t, http.StatusBadRequest, result.Code()) + requireHTTPCode(t, http.StatusBadRequest, result) reason := &api.Reason{} err := result.UnmarshalJsonToObject(reason) assert.NoError(t, err) @@ -147,7 +148,7 @@ func TestCreateTenantEmpty(t *testing.T) { Post("/tenants/"). WithHeader(echo.HeaderAuthorization, bearerToken). Go(t, e) - assert.Equal(t, http.StatusBadRequest, result.Code()) + requireHTTPCode(t, http.StatusBadRequest, result) reason := &api.Reason{} err := result.UnmarshalJsonToObject(reason) assert.NoError(t, err) @@ -166,7 +167,8 @@ func TestCreateTenantNoGitURL(t *testing.T) { WithHeader(echo.HeaderAuthorization, bearerToken). WithJsonBody(newTenant). Go(t, e) - assert.Equal(t, http.StatusBadRequest, result.Code()) + requireHTTPCode(t, http.StatusBadRequest, result) + reason := &api.Reason{} err := result.UnmarshalJsonToObject(reason) assert.NoError(t, err) @@ -180,7 +182,7 @@ func TestTenantDelete(t *testing.T) { Delete("/tenants/"+tenantA.Name). WithHeader(echo.HeaderAuthorization, bearerToken). Go(t, e) - assert.Equal(t, http.StatusNoContent, result.Code()) + requireHTTPCode(t, http.StatusNoContent, result) } func TestTenantGet(t *testing.T) { @@ -190,11 +192,11 @@ func TestTenantGet(t *testing.T) { Get("/tenants/"+tenantA.Name). WithHeader(echo.HeaderAuthorization, bearerToken). Go(t, e) - assert.Equal(t, http.StatusOK, result.Code()) + requireHTTPCode(t, http.StatusOK, result) tenant := &api.Tenant{} err := result.UnmarshalJsonToObject(tenant) assert.NoError(t, err) - assert.Equal(t, tenantA.Name, string(tenant.Id)) + assert.Equal(t, tenantA.Name, tenant.Id.String()) assert.Equal(t, tenantA.Spec.DisplayName, *tenant.DisplayName) assert.Equal(t, tenantA.Spec.GitRepoURL, *tenant.GitRepo.Url) assert.Contains(t, *tenant.Annotations, "monitoring.syn.tools/sla") @@ -208,7 +210,7 @@ func TestTenantUpdateEmpty(t *testing.T) { Patch("/tenants/1"). WithHeader(echo.HeaderAuthorization, bearerToken). Go(t, e) - assert.Equal(t, http.StatusBadRequest, result.Code()) + requireHTTPCode(t, http.StatusBadRequest, result) reason := &api.Reason{} err := result.UnmarshalJsonToObject(reason) assert.NoError(t, err) @@ -230,7 +232,7 @@ func TestTenantUpdateUnknown(t *testing.T) { WithContentType(api.ContentJSONPatch). WithHeader(echo.HeaderAuthorization, bearerToken). Go(t, e) - assert.Equal(t, http.StatusBadRequest, result.Code()) + requireHTTPCode(t, http.StatusBadRequest, result) reason := &api.Reason{} err := result.UnmarshalJsonToObject(reason) assert.NoError(t, err) @@ -259,12 +261,12 @@ func TestTenantUpdate(t *testing.T) { WithContentType(api.ContentJSONPatch). WithHeader(echo.HeaderAuthorization, bearerToken). Go(t, e) - assert.Equal(t, http.StatusOK, result.Code()) + requireHTTPCode(t, http.StatusOK, result) tenant := &api.Tenant{} err := result.UnmarshalJsonToObject(tenant) assert.NoError(t, err) assert.NotNil(t, tenant) - assert.Contains(t, string(tenant.Id), tenantB.Name) + assert.Contains(t, tenant.Id.String(), tenantB.Name) assert.Equal(t, newDisplayName, *tenant.DisplayName) assert.Contains(t, *tenant.Annotations, "some") assert.Len(t, *tenant.Annotations, 1) @@ -287,7 +289,7 @@ func TestTenantUpdateDisplayName(t *testing.T) { WithContentType(api.ContentJSONPatch). WithHeader(echo.HeaderAuthorization, bearerToken). Go(t, e) - assert.Equal(t, http.StatusOK, result.Code()) + requireHTTPCode(t, http.StatusOK, result) tenant := &api.Tenant{} err := result.UnmarshalJsonToObject(tenant) assert.NoError(t, err) @@ -330,7 +332,7 @@ var putTenantTestCases = map[string]struct { "put new object": { tenant: &api.Tenant{ TenantId: api.TenantId{ - Id: "t-buzz-24", + Id: pointer.To(api.Id("t-buzz-24")), }, TenantProperties: api.TenantProperties{ DisplayName: pointer.ToString("My test Tenant"), @@ -360,7 +362,7 @@ func TestTenantPut(t *testing.T) { WithJsonBody(tc.tenant). WithHeader(echo.HeaderAuthorization, bearerToken). Go(t, e) - require.Equal(t, tc.code, result.Code()) + requireHTTPCode(t, tc.code, result) res := &api.Tenant{} err := result.UnmarshalJsonToObject(res) diff --git a/tools.go b/tools.go index 0e326cc..4f26c01 100644 --- a/tools.go +++ b/tools.go @@ -4,5 +4,5 @@ package main import ( - _ "github.com/deepmap/oapi-codegen/pkg/codegen" + _ "github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen" )